<!doctype html><meta charset="utf-8"><title>mikupad</title><meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0"><script type="importmap">
{
	"imports": {
		"react": "https://esm.sh/react@18",
		"react-dom/client": "https://esm.sh/react-dom@18/client?external=react",
		"htm/react": "https://esm.sh/htm@3/react?external=react&react=18",
		"scrollview-resize": "https://esm.sh/scrollview-resize@1.0.2"
	}
}
</script><style>html{--color-miku:#009bb3;--color-base-0:oklch(.2 .02 60);--color-base-10:color-mix(in oklch,var(--color-base-100)10%,var(--color-base-0));--color-base-20:color-mix(in oklch,var(--color-base-100)20%,var(--color-base-0));--color-base-30:color-mix(in oklch,var(--color-base-100)30%,var(--color-base-0));--color-base-40:color-mix(in oklch,var(--color-base-100)40%,var(--color-base-0));--color-base-50:color-mix(in oklch,var(--color-base-100)50%,var(--color-base-0));--color-base-60:color-mix(in oklch,var(--color-base-100)60%,var(--color-base-0));--color-base-70:color-mix(in oklch,var(--color-base-100)70%,var(--color-base-0));--color-base-80:color-mix(in oklch,var(--color-base-100)80%,var(--color-base-0));--color-base-90:color-mix(in oklch,var(--color-base-100)90%,var(--color-base-0));--color-base-100:oklch(.95 .04 70);--color-dark:var(--color-base-0);--color-light:var(--color-base-100);accent-color:var(--color-base-30);background:var(--color-base-20);color:var(--color-base-0);flex-direction:column;min-height:100%;font-family:serif;font-size:16px;display:flex}html.serif-dark{--color-base-0:oklch(.95 .04 30);--color-base-10:color-mix(in oklch,var(--color-base-100)10%,var(--color-base-0));--color-base-20:color-mix(in oklch,var(--color-base-100)80%,var(--color-base-0));--color-base-30:color-mix(in oklch,var(--color-base-100)70%,var(--color-base-0));--color-base-40:color-mix(in oklch,var(--color-base-100)60%,var(--color-base-0));--color-base-50:color-mix(in oklch,var(--color-base-100)50%,var(--color-base-0));--color-base-60:color-mix(in oklch,var(--color-base-100)40%,var(--color-base-0));--color-base-70:color-mix(in oklch,var(--color-base-100)30%,var(--color-base-0));--color-base-80:color-mix(in oklch,var(--color-base-100)20%,var(--color-base-0));--color-base-90:color-mix(in oklch,var(--color-base-100)10%,var(--color-base-0));--color-base-100:oklch(.2 .02 30);--color-dark:var(--color-base-100);--color-light:var(--color-base-0);color-scheme:dark}html.nockoffAI{---color-bg-dark:#191b31;--color-bg:#191b31;--color-text:#fff;--color-base-0:#fff;--color-base-10:color-mix(in oklch,var(--color-base-100)90%,var(--color-base-0));--color-base-20:color-mix(in oklch,var(--color-base-100)80%,var(--color-base-0));--color-base-30:color-mix(in oklch,var(--color-base-100)70%,var(--color-base-0));--color-base-40:color-mix(in oklch,var(--color-base-100)60%,var(--color-base-0));--color-base-50:color-mix(in oklch,var(--color-base-100)50%,var(--color-base-0));--color-base-60:color-mix(in oklch,var(--color-base-100)40%,var(--color-base-0));--color-base-70:color-mix(in oklch,var(--color-base-100)30%,var(--color-base-0));--color-base-80:color-mix(in oklch,var(--color-base-100)20%,var(--color-base-0));--color-base-90:color-mix(in oklch,var(--color-base-100)10%,var(--color-base-0));--color-base-100:#13152c;--color-dark:var(--color-base-100);--color-light:#fff;--color-input:#0e0f21;--color-sidebar:var(--color-base-100);--color-prompt-area:#191b31;--color-hover:#13152c;--color-button:#22253f;--color-disabled:#161833;--color-button-hover:#282b44;--token-prob-box:#4a4a4a;accent-color:var(--color-base-30);background:var(--color-bg-dark);color:var(--color-base-0);color-scheme:dark;font-family:Source Sans Pro,Helvetica Neue,sans-serif;font-size:15.5px}html.nockoffAI body{background:var(--color-prompt-area)}html.monospace-dark{---color-bg-dark:#282833;--color-bg:#202020;--color-text:#bababa;--color-base-0:oklch(77.65% .0752 285.22);--color-base-10:color-mix(in oklch,var(--color-base-100)90%,var(--color-base-0));--color-base-20:color-mix(in oklch,var(--color-base-100)80%,var(--color-base-0));--color-base-30:color-mix(in oklch,var(--color-base-100)70%,var(--color-base-0));--color-base-40:color-mix(in oklch,var(--color-base-100)60%,var(--color-base-0));--color-base-50:color-mix(in oklch,var(--color-base-100)50%,var(--color-base-0));--color-base-60:color-mix(in oklch,var(--color-base-100)40%,var(--color-base-0));--color-base-70:color-mix(in oklch,var(--color-base-100)30%,var(--color-base-0));--color-base-80:color-mix(in oklch,var(--color-base-100)20%,var(--color-base-0));--color-base-90:color-mix(in oklch,var(--color-base-100)10%,var(--color-base-0));--color-base-100:oklch(24.28% .015 285.22);--color-dark:var(--color-base-100);--color-light:var(--color-base-0);--token-prob-box:#4a4a4a;accent-color:var(--color-base-30);background:var(--color-bg-dark);color:var(--color-base-0);color-scheme:dark;font-family:monospace;font-size:15px}body{flex-direction:row;flex:auto;margin:0;display:flex}@media (width>=calc(40.5em + 250px)){body.attachSidebar{margin-left:auto;margin-right:auto}}#prompt-container{flex-direction:column;flex:1;max-width:36em;margin-left:auto;margin-right:auto;font-size:1.125rem;display:flex;position:relative}@media (width>=calc(40.5em + 250px)){body.attachSidebar #prompt-container{min-width:36em;max-width:36em}}#prompt-area,#prompt-overlay{resize:none;background:var(--color-base-100);color:var(--color-base-10);scrollbar-gutter:stable;font:inherit;box-sizing:content-box;-moz-text-size-adjust:100%;text-size-adjust:100%;word-wrap:break-word;border:none;outline:none;flex:1;margin:0;padding:2em 3em}html.monospace-dark #prompt-area,html.monospace-dark #memory-area,html.monospace-dark #an-area,html.monospace-dark .expanded-text-area-settings,html.monospace-dark .wi-textarea{background:var(--color-bg);color:var(--color-text)}html.nockoffAI #prompt-area{text-indent:1em each-line;background:var(--color-prompt-area);color:var(--color-text)}html.nockoffAI #prompt-overlay{text-indent:1em each-line}html.nockoffAI #memory-area,html.nockoffAI #an-area,html.nockoffAI .expanded-text-area-settings,html.nockoffAI .wi-textarea{background:var(--color-input);color:var(--color-text)}.modal .wi-textarea{resize:vertical;background:var(--color-base-100);color:var(--color-base-10)}#memory-area,#an-area,.expanded-text-area-settings,.wi-textarea{resize:none;background:var(--color-base-100);color:var(--color-base-10);scrollbar-gutter:stable;border:none;border-radius:2px;outline:none;flex:1;padding:.5em;font-family:inherit}#memory-area{min-height:9.5em}#an-area{min-height:3.5em}.wi-textarea{min-height:4em}#advancedContextPlaceholders{background:var(--color-base-30);border-radius:2px;width:-moz-fit-content;width:fit-content;margin:1em auto;padding:.25em}#advancedContextPlaceholders table{border-color:var(--color-base-80)}#advancedContextPlaceholders th,#advancedContextPlaceholders td{text-align:center;padding:.15em}#advancedContextPlaceholders td{-webkit-user-select:all;user-select:all}#advanced-context-order-settings{min-height:3.5em}.expanded-text-area-settings{box-sizing:border-box;width:100%;height:25.5em;margin:8px 0}#prompt-overlay{white-space:pre-wrap;color:#0000;pointer-events:none;-webkit-user-select:none;user-select:none;background:0 0;position:absolute;inset:0;overflow:hidden;transform:translate(0)}#prompt-container:hover #prompt-overlay>.machine{background:color-mix(in srgb,var(--bg-color,var(--color-miku))10%,transparent)}#prompt-container #prompt-overlay>.machine.erase{background:#ff00001a}#prompt-container #prompt-overlay>.machine.current{outline:1px solid var(--color-base-50);outline-offset:1px;border-radius:3px}#probs{background:var(--color-base-30);top:var(--probs-top);left:var(--probs-left);z-index:9999;scrollbar-width:thin;border-radius:5px;max-width:99%;display:flex;position:absolute;overflow-x:auto;transform:translate(-50%,-100%);box-shadow:0 1px 1px 1px #0003}html.monospace-dark #probs,html.nockoffAI #probs{background:var(--color-base-10);border:1px solid var(--token-prob-box);box-shadow:none;border-radius:4px}#probs>button{cursor:pointer;color:var(--color-light);background:0 0;border-radius:0;flex-direction:column;flex:none;padding:4px 8px;font-size:1rem;display:flex}#probs>button.current{background:var(--color-base-40)}#probs>button:first-child{border-radius:5px 0 0 5px;padding-left:6px}#probs>button:last-child{border-radius:0 5px 5px 0;padding-right:6px}#probs>button:hover{background:var(--color-base-40)}#probs>button:active{background:var(--color-base-50)}#probs>button>.prob{font-size:.8rem}.modal-overlay{background:#000000a6;justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:fixed;top:0;left:0}.modal-container{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.modal{color:var(--color-light);background:var(--color-base-50);border-radius:5px;flex-direction:column;width:75%;max-height:80vh;padding:1em;display:flex;position:relative}html.monospace-dark .modal{background:#282833}html.nockoffAI .modal{background:var(--color-sidebar);color:var(--color-base-50)}html.nockoffAI .modal-title{color:var(--color-text)}html.nockoffAI #context-order-desc,html.nockoffAI #contextTokensTable,html.nockoffAI .modal-desc{color:var(--color-base-80)}.button-modal-top{all:unset;border-radius:3px;width:1.25em;height:1.25em;position:absolute;top:1em;right:1em}.modal-title{margin-bottom:.25em;font-size:150%;font-weight:700}.modal-content{overflow:hidden}hr{border:unset;border-top:1px solid var(--color-base-40);margin:.75em -1em .5em}.modal-wi-content{flex-direction:column;max-height:50vh;margin-top:.5em;display:flex}#modal-wi-global{flex-direction:column;gap:4px;display:flex}#button-wi-new{width:100%}.wi-entry{margin:4px 0}.wi-entry-controls{border-top:1px solid var(--color-base-40);grid-template:"wi-entry-filler wi-entry-name."min-content"wi-entry-buttons wi-entry-text."1fr/min-content 1fr;padding-top:8px;display:grid}.wi-entry-filler{grid-area:wi-entry-filler}.wi-entry-name{grid-area:wi-entry-name;margin-bottom:8px}.wi-entry-name input{background:var(--color-base-60);font-size:1.2rem!important;font-weight:700!important}html.nockoffAI .wi-entry-name input{background:var(--color-base-10)!important}.wi-entry-buttons{grid-area:wi-entry-buttons;justify-content:center;align-items:center;margin-right:4px;display:flex}.wi-entry-buttons-container{flex-direction:column;justify-content:space-between;height:5em;display:flex}.wi-entry-buttons button{width:2em;height:-moz-fit-content;height:fit-content;display:grid}.wi-entry-text{grid-area:wi-entry-text}.wi-entry-text .hbox{grid-area:wi-entry-text;margin-bottom:4px}.symbol-button{width:2.182rem;height:1.625rem;margin-top:auto;position:relative}.symbol-button>svg{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.hbox-button{width:1.625rem;margin-top:auto}.hbox-flex{flex-direction:row;gap:8px;display:flex}.hbox-flex>.InputBox{width:100%}.small-inputBox{width:8em}.logitBiasContainer{position:relative;flex-wrap:unset!important}.logitBiasPower-sidebar{width:10ch!important}.overflow-container{overflow-y:auto}#logitBiasPower{text-align:center}.lb-modal-grid-column{grid-auto-rows:min-content;gap:8px;max-height:40vh;padding-right:.75em;display:grid}.lb-modal-grid-row{grid-template:"power input add"min-content".tokens remove"min-content"hr hr hr"min-content/4em 1fr min-content;gap:1px 8px;padding:1px;display:grid}.lb-modal-power{text-align:center;grid-area:power}.lb-modal-input{text-align:left;grid-area:input}.lb-modal-button.lb-modal-button-add{grid-area:add}.lb-modal-button.lb-modal-button-remove{grid-area:remove}.lb-modal-tokenized{overflow-wrap:anywhere;grid-area:tokens;align-content:center;width:100%;margin:auto 0;font-family:monospace;font-size:.7rem;display:grid}.lb-modal-biasList hr{grid-area:hr;width:90%;margin:4px auto auto}.lb-modal-biasList{grid-template-columns:1fr 1fr;gap:8px;display:grid}#instructmodal-name{size:110%}.instructmodal-edits .hbox,.instructmodal-edits .vbox{margin-top:8px}#sidebar{background:var(--color-base-50);color:var(--color-light);flex-direction:column;gap:4px;width:250px;max-height:calc(100vh - 8px);padding:4px 8px;font-family:inherit;display:flex;overflow:auto}html.monospace-dark #sidebar{background:#282833;width:265px}html.nockoffAI #sidebar{background:var(--color-sidebar);color:var(--color-base-50);width:255px}.flex1{flex:1}.hbox{flex:none;grid:auto/auto-flow minmax(min-content,1fr);gap:8px;display:grid}.hbox-flex{flex-wrap:wrap;gap:8px;display:flex}.vbox{grid:auto/minmax(min-content,1fr)auto-flow;flex:none;grid-template-rows:0fr 0fr 0fr 0fr;gap:4px;display:grid}.InputBox,.SelectBox,.TextArea{flex-direction:column;padding:0 8px;font-size:.75rem;display:flex;position:relative}.InputBox>div>input,.SelectBox>select,.TextArea>textarea{appearance:none;box-sizing:content-box;font:inherit;color:inherit;background:var(--color-base-30);border:none;border-radius:2px;outline:none;flex:none;width:100%;margin:0 -8px;padding:4px 8px;font-size:1rem}html.monospace-dark .InputBox>div>input,html.monospace-dark .SelectBox>select,html.nockoffAI .InputBox>div>input,html.nockoffAI .SelectBox>select{color:var(--color-light)}.InputBox>div>input:read-only{background:var(--color-base-60)}html.monospace-dark .InputBox>div>input:read-only{background:var(--color-base-30)}html.nockoffAI .InputBox>div>input:read-only{background:var(--color-disabled)}html.nockoffAI .SelectBox>select,html.nockoffAI .collapsible-header,html.nockoffAI .InputBox>div>input{background:var(--color-input)}html.nockoffAI .horz-separator{border-top:3px dotted color-mix(in oklch,var(--color-base-100)90%,var(--color-light))}.InputBox>div>input:focus-visible{outline:1px solid var(--color-base-0)}.SelectBox>select:disabled{background:var(--color-base-60)}html.nockoffAI .SelectBox>select:disabled{background:var(--color-disabled)}.relative{position:relative}.Checkbox{-webkit-user-select:none;user-select:none;vertical-align:middle;margin:0 5px 0 0;position:relative;bottom:.08em}.InputBox>div>input.mixed-content{outline:1px solid #ff0}.InputBox>div>input.rejected{outline:1px solid #ff3131}.InputBox>div>button{margin-left:4px;margin-right:-8px;padding:4px;line-height:0}.tooltip{position:relative}.tooltip .tooltiptext{white-space:pre-wrap;pointer-events:none;color:var(--color-light);text-align:center;opacity:0;z-index:1;background-color:#000a;border-radius:6px;width:95%;margin:0 -8px;padding:5px 4px;transition:opacity .3s;position:absolute;transform:translateY(-75%)}html.monospace-dark .tooltip .tooltiptext{transform:translateY(-65%)}.tooltip .tooltiptext.short{transform:translateY(-45%)}html.monospace-dark .tooltip .tooltiptext.short{transform:translateY(-65%)}.tooltip:hover .tooltiptext{opacity:1}.error-text{text-align:center;color:#ff8080;background:#4e3534;border-radius:4px;width:max-content;margin-left:auto;margin-right:auto;padding:2px 10px}button{appearance:none;font:inherit;color:inherit;background:var(--color-base-30);border:none;border-radius:2px;outline:none;padding:4px 8px}html.nockoffAI button{background:var(--color-button);color:var(--color-base-90)}html.nockoffAI .Session button:not(:hover),html.nockoffAI button.textAreaSettings:not(:hover){background:0 0}button.textAreaSettings{all:unset;color:var(--color-base-50);width:1.25em;position:absolute;top:calc(1.25em + 1px);right:1px}button.textAreaSettings.textAreaSettings-bias{top:1.45em;right:5px}.token-counter{pointer-events:none;color:var(--color-base-50);background:color-mix(in srgb,var(--color-base-30),transparent 50%);position:absolute;bottom:0;right:0;transform:translateY(-50%)}.token-counter:after{content:" Tokens"}button:hover{background:var(--color-base-40)}html.nockoffAI button:hover{background:var(--color-button-hover)}button:active{background:var(--color-base-50)}button:disabled{background:var(--color-base-60)}html.nockoffAI button:disabled{background:var(--color-disabled)}button:focus-visible{outline:1px solid var(--color-base-0)}button.processing{outline:1px solid #ffffff80;animation:.5s ease-out infinite alternate processing}@keyframes processing{0%{outline-width:0}to{outline-width:4px}}button.completing{outline:1px solid #32cd32;animation:.5s ease-out infinite alternate completing}@keyframes completing{0%{outline-width:0}to{outline-width:4px}}.buttons{justify-content:center;gap:8px;display:flex}.buttons .shorts{line-height:0}.buttons .shorts>button{height:100%}.instructTemplatesImportExport{gap:8px;width:-moz-fit-content;width:fit-content;margin:auto;display:flex}.instructTemplateSidebar>.SelectBox{width:100%}.instructTemplateSidebar>.hbox-button{min-width:max-content}.collapsible-group{border:none;outline:none}.collapsible-header{-webkit-user-select:none;user-select:none;cursor:pointer;color:inherit;background-color:var(--color-base-30);border-radius:2px;align-items:center;padding:4px 8px;display:flex}.collapsible-header svg{margin-right:5px}.collapsible-content{transform-origin:top;flex-direction:column;gap:4px;transition:transform .15s ease-in-out,max-height .15s ease-in-out;display:flex;transform:scaleY(0)}.collapsible-content.expanded{margin-top:4px;transform:scaleY(1)}.Sessions{flex-direction:row;flex:auto;gap:4px;display:flex}.Sessions>ul{background:var(--color-base-40);width:100%;max-height:200px;margin:0;padding:0;list-style-type:none;overflow-y:auto}html.monospace-dark .Sessions>ul{background:var(--color-base-20)}html.nockoffAI .Sessions>ul{background:var(--color-input)}.Sessions.disabled>ul{background:var(--color-base-50);pointer-events:auto}html.nockoffAI .Sessions.disabled>ul{background:var(--color-disabled)}.Sessions>ul>li{align-items:center;display:flex}.Sessions.disabled>ul>li{pointer-events:none}.Session{cursor:pointer;word-break:break-word;-webkit-user-select:none;user-select:none;width:100%;padding:.5rem .5rem .5rem .8rem;display:flex}html.nockoffAI .Session{color:var(--color-base-70);margin:.25rem;padding:.25rem}html.nockoffAI .Session>input{background-color:var(--color-input);outline:none}html.nockoffAI .Session.selected{color:var(--color-text);background-color:var(--color-prompt-area)}.Session:hover{background-color:var(--color-base-60)}html.monospace-dark .Session:hover{background-color:var(--color-base-40)}html.nockoffAI .Session:hover{background-color:var(--color-hover)}.Session.selected{background-color:var(--color-base-30)}html.monospace-dark .Session.selected{background-color:var(--color-base-10)}.Session>button{cursor:pointer;opacity:.5;background:0 0;border:none;outline:none;margin-left:4px;padding:0;line-height:0}.Session>button:hover{opacity:1}.Session>input{appearance:none;outline:1px solid var(--color-light);background-color:var(--color-base-40);font:inherit;color:inherit;border:none;width:80%;margin-right:5%;padding:0}#error-bar{color:#ff8080;text-align:center;background-color:#4e3534;min-height:0;position:absolute;top:0;left:0;right:0;box-shadow:0 4px 6px #0000001a}#error-bar div{padding:10px}.flex-separator{margin-left:auto}.horz-separator{border-top:3px dotted var(--color-base-60)}html.monospace-dark .horz-separator{border-top:3px dotted var(--color-base-20)}.eye-button{width:1.891rem;height:1.625rem;margin-top:auto;position:relative}html.monospace-dark .eye-button{width:1.891rem;height:1.725rem;margin-top:auto;position:relative}.eye-button>svg{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#button-settings{display:none}@media (width<=767.98px){body{flex-direction:column}#prompt-container{width:100%;max-width:100%;border:none!important}#sidebar,html.monospace-dark #sidebar,html.nockoffAI #sidebar{width:auto;max-height:calc(93vh - 8px);position:fixed;bottom:0;left:0;right:0}#sidebar .SelectBox:first-child,.horz-separator,.collapsible-group{display:none}#button-settings{display:block}}@media (width>=767.98px){#sidebar .SelectBox:first-child,.horz-separator,.collapsible-group{display:block!important}}</style><script type="module">function e(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var t,n=globalThis,r={},a={},l=n.parcelRequiree0b1;null==l&&((l=function(e){if(e in r)return r[e].exports;if(e in a){var t=a[e];delete a[e];var n={id:e,exports:{}};return r[e]=n,t.call(n.exports,n,n.exports),n.exports}var l=Error("Cannot find module '"+e+"'");throw l.code="MODULE_NOT_FOUND",l}).register=function(e,t){a[e]=t},n.parcelRequiree0b1=l);var o=l.register;o("2pUnB",function(t,n){e(t.exports,"Children",()=>r,e=>r=e),e(t.exports,"Component",()=>a,e=>a=e),e(t.exports,"Fragment",()=>l,e=>l=e),e(t.exports,"Profiler",()=>o,e=>o=e),e(t.exports,"PureComponent",()=>i,e=>i=e),e(t.exports,"StrictMode",()=>u,e=>u=e),e(t.exports,"Suspense",()=>s,e=>s=e),e(t.exports,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",()=>c,e=>c=e),e(t.exports,"act",()=>d,e=>d=e),e(t.exports,"cloneElement",()=>f,e=>f=e),e(t.exports,"createContext",()=>p,e=>p=e),e(t.exports,"createElement",()=>h,e=>h=e),e(t.exports,"createFactory",()=>m,e=>m=e),e(t.exports,"createRef",()=>y,e=>y=e),e(t.exports,"forwardRef",()=>g,e=>g=e),e(t.exports,"isValidElement",()=>v,e=>v=e),e(t.exports,"lazy",()=>b,e=>b=e),e(t.exports,"memo",()=>w,e=>w=e),e(t.exports,"startTransition",()=>k,e=>k=e),e(t.exports,"unstable_act",()=>x,e=>x=e),e(t.exports,"useCallback",()=>$,e=>$=e),e(t.exports,"useContext",()=>S,e=>S=e),e(t.exports,"useDebugValue",()=>E,e=>E=e),e(t.exports,"useDeferredValue",()=>C,e=>C=e),e(t.exports,"useEffect",()=>P,e=>P=e),e(t.exports,"useId",()=>T,e=>T=e),e(t.exports,"useImperativeHandle",()=>F,e=>F=e),e(t.exports,"useInsertionEffect",()=>N,e=>N=e),e(t.exports,"useLayoutEffect",()=>A,e=>A=e),e(t.exports,"useMemo",()=>_,e=>_=e),e(t.exports,"useReducer",()=>D,e=>D=e),e(t.exports,"useRef",()=>L,e=>L=e),e(t.exports,"useState",()=>O,e=>O=e),e(t.exports,"useSyncExternalStore",()=>I,e=>I=e),e(t.exports,"useTransition",()=>B,e=>B=e),e(t.exports,"version",()=>z,e=>z=e);var r,a,l,o,i,u,s,c,d,f,p,h,m,y,g,v,b,w,k,x,$,S,E,C,P,T,F,N,A,_,D,L,O,I,B,z,M=Symbol.for("react.element"),R=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),H=Symbol.for("react.provider"),W=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),X=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),J=Symbol.iterator,Y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G=Object.assign,Z={};function ee(e,t,n){this.props=e,this.context=t,this.refs=Z,this.updater=n||Y}function et(){}function en(e,t,n){this.props=e,this.context=t,this.refs=Z,this.updater=n||Y}ee.prototype.isReactComponent={},ee.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},ee.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},et.prototype=ee.prototype;var er=en.prototype=new et;er.constructor=en,G(er,ee.prototype),er.isPureReactComponent=!0;var ea=Array.isArray,el=Object.prototype.hasOwnProperty,eo={current:null},ei={key:!0,ref:!0,__self:!0,__source:!0};function eu(e,t,n){var r,a={},l=null,o=null;if(null!=t)for(r in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(l=""+t.key),t)el.call(t,r)&&!ei.hasOwnProperty(r)&&(a[r]=t[r]);var i=arguments.length-2;if(1===i)a.children=n;else if(1<i){for(var u=Array(i),s=0;s<i;s++)u[s]=arguments[s+2];a.children=u}if(e&&e.defaultProps)for(r in i=e.defaultProps)void 0===a[r]&&(a[r]=i[r]);return{$$typeof:M,type:e,key:l,ref:o,props:a,_owner:eo.current}}function es(e){return"object"==typeof e&&null!==e&&e.$$typeof===M}var ec=/\/+/g;function ed(e,t){var n,r;return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36)}function ef(e,t,n){if(null==e)return e;var r=[],a=0;return function e(t,n,r,a,l){var o,i,u,s=typeof t;("undefined"===s||"boolean"===s)&&(t=null);var c=!1;if(null===t)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case M:case R:c=!0}}if(c)return l=l(c=t),t=""===a?"."+ed(c,0):a,ea(l)?(r="",null!=t&&(r=t.replace(ec,"$&/")+"/"),e(l,n,r,"",function(e){return e})):null!=l&&(es(l)&&(o=l,i=r+(!l.key||c&&c.key===l.key?"":(""+l.key).replace(ec,"$&/")+"/")+t,l={$$typeof:M,type:o.type,key:i,ref:o.ref,props:o.props,_owner:o._owner}),n.push(l)),1;if(c=0,a=""===a?".":a+":",ea(t))for(var d=0;d<t.length;d++){var f=a+ed(s=t[d],d);c+=e(s,n,r,f,l)}else if("function"==typeof(f=null===(u=t)||"object"!=typeof u?null:"function"==typeof(u=J&&u[J]||u["@@iterator"])?u:null))for(t=f.call(t),d=0;!(s=t.next()).done;)f=a+ed(s=s.value,d++),c+=e(s,n,r,f,l);else if("object"===s)throw Error("Objects are not valid as a React child (found: "+("[object Object]"===(n=String(t))?"object with keys {"+Object.keys(t).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.");return c}(e,r,"","",function(e){return t.call(n,e,a++)}),r}function ep(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){(0===e._status||-1===e._status)&&(e._status=1,e._result=t)},function(t){(0===e._status||-1===e._status)&&(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var eh={current:null},em={transition:null};function ey(){throw Error("act(...) is not supported in production builds of React.")}r={map:ef,forEach:function(e,t,n){ef(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ef(e,function(){t++}),t},toArray:function(e){return ef(e,function(e){return e})||[]},only:function(e){if(!es(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},a=ee,l=j,o=U,i=en,u=V,s=Q,c={ReactCurrentDispatcher:eh,ReactCurrentBatchConfig:em,ReactCurrentOwner:eo},d=ey,f=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=G({},e.props),a=e.key,l=e.ref,o=e._owner;if(null!=t){if(void 0!==t.ref&&(l=t.ref,o=eo.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(u in t)el.call(t,u)&&!ei.hasOwnProperty(u)&&(r[u]=void 0===t[u]&&void 0!==i?i[u]:t[u])}var u=arguments.length-2;if(1===u)r.children=n;else if(1<u){i=Array(u);for(var s=0;s<u;s++)i[s]=arguments[s+2];r.children=i}return{$$typeof:M,type:e.type,key:a,ref:l,props:r,_owner:o}},p=function(e){return(e={$$typeof:W,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:H,_context:e},e.Consumer=e},h=eu,m=function(e){var t=eu.bind(null,e);return t.type=e,t},y=function(){return{current:null}},g=function(e){return{$$typeof:K,render:e}},v=es,b=function(e){return{$$typeof:q,_payload:{_status:-1,_result:e},_init:ep}},w=function(e,t){return{$$typeof:X,type:e,compare:void 0===t?null:t}},k=function(e){var t=em.transition;em.transition={};try{e()}finally{em.transition=t}},x=ey,$=function(e,t){return eh.current.useCallback(e,t)},S=function(e){return eh.current.useContext(e)},E=function(){},C=function(e){return eh.current.useDeferredValue(e)},P=function(e,t){return eh.current.useEffect(e,t)},T=function(){return eh.current.useId()},F=function(e,t,n){return eh.current.useImperativeHandle(e,t,n)},N=function(e,t){return eh.current.useInsertionEffect(e,t)},A=function(e,t){return eh.current.useLayoutEffect(e,t)},_=function(e,t){return eh.current.useMemo(e,t)},D=function(e,t,n){return eh.current.useReducer(e,t,n)},L=function(e){return eh.current.useRef(e)},O=function(e){return eh.current.useState(e)},I=function(e,t,n){return eh.current.useSyncExternalStore(e,t,n)},B=function(){return eh.current.useTransition()},z="18.3.1"}),o("Xw6Mv",function(t,n){e(t.exports,"__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED",()=>U,e=>U=e),e(t.exports,"createPortal",()=>H,e=>H=e),e(t.exports,"createRoot",()=>W,e=>W=e),e(t.exports,"findDOMNode",()=>K,e=>K=e),e(t.exports,"flushSync",()=>Q,e=>Q=e),e(t.exports,"hydrate",()=>X,e=>X=e),e(t.exports,"hydrateRoot",()=>q,e=>q=e),e(t.exports,"render",()=>J,e=>J=e),e(t.exports,"unmountComponentAtNode",()=>Y,e=>Y=e),e(t.exports,"unstable_batchedUpdates",()=>G,e=>G=e),e(t.exports,"unstable_renderSubtreeIntoContainer",()=>Z,e=>Z=e),e(t.exports,"version",()=>ee,e=>ee=e);var r,a,o,i,u,s,c=l("acw62"),d=l("fO90s");function f(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var p=new Set,h={};function m(e,t){y(e,t),y(e+"Capture",t)}function y(e,t){for(h[e]=t,e=0;e<t.length;e++)p.add(t[e])}var g=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),v=Object.prototype.hasOwnProperty,b=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,w={},k={};function x(e,t,n,r,a,l,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=o}var $={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$[e]=new x(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$[t]=new x(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){$[e]=new x(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$[e]=new x(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$[e]=new x(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){$[e]=new x(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){$[e]=new x(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){$[e]=new x(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){$[e]=new x(e,5,!1,e.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function E(e){return e[1].toUpperCase()}function C(e,t,n,r){var a,l=$.hasOwnProperty(t)?$[t]:null;(null!==l?0!==l.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":if(r)return!1;if(null!==n)return!n.acceptsBooleans;return"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e;default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,l,r)&&(n=null),r||null===l?(a=t,(!!v.call(k,a)||!v.call(w,a)&&(b.test(a)?k[a]=!0:(w[a]=!0,!1)))&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n))):l.mustUseProperty?e[l.propertyName]=null===n?3!==l.type&&"":n:(t=l.attributeName,r=l.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(l=l.type)||4===l&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(S,E);$[t]=new x(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(S,E);$[t]=new x(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(S,E);$[t]=new x(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){$[e]=new x(e,1,!1,e.toLowerCase(),null,!1,!1)}),$.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){$[e]=new x(e,1,!1,e.toLowerCase(),null,!0,!0)});var P=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=Symbol.for("react.element"),F=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),L=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),M=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var R=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var j=Symbol.iterator;function V(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=j&&e[j]||e["@@iterator"])?e:null}var U,H,W,K,Q,X,q,J,Y,G,Z,ee,et,en=Object.assign;function er(e){if(void 0===et)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);et=t&&t[1]||""}return"\n"+et+e}var ea=!1;function el(e,t){if(!e||ea)return"";ea=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t){if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var a=t.stack.split("\n"),l=r.stack.split("\n"),o=a.length-1,i=l.length-1;1<=o&&0<=i&&a[o]!==l[i];)i--;for(;1<=o&&0<=i;o--,i--)if(a[o]!==l[i]){if(1!==o||1!==i)do if(o--,0>--i||a[o]!==l[i]){var u="\n"+a[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=o&&0<=i)break}}}finally{ea=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?er(e):""}function eo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function ei(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function eu(e){e._valueTracker||(e._valueTracker=function(e){var t=ei(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var a=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){r=""+e,l.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function es(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ei(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function ec(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function ed(e,t){var n=t.checked;return en({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ef(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=eo(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function ep(e,t){null!=(t=t.checked)&&C(e,"checked",t,!1)}function eh(e,t){ep(e,t);var n=eo(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r){e.removeAttribute("value");return}t.hasOwnProperty("value")?ey(e,t.type,n):t.hasOwnProperty("defaultValue")&&ey(e,t.type,eo(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function em(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ey(e,t,n){("number"!==t||ec(e.ownerDocument)!==e)&&(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var eg=Array.isArray;function ev(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(a=0,n=""+eo(n),t=null;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}null!==t||e[a].disabled||(t=e[a])}null!==t&&(t.selected=!0)}}function eb(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(f(91));return en({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ew(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(f(92));if(eg(n)){if(1<n.length)throw Error(f(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:eo(n)}}function ek(e,t){var n=eo(t.value),r=eo(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ex(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function e$(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function eS(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?e$(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var eE,eC,eP=(eE=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((eC=eC||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=eC.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return eE(e,t,n,r)})}:eE);function eT(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType){n.nodeValue=t;return}}e.textContent=t}var eF={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},eN=["Webkit","ms","Moz","O"];function eA(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||eF.hasOwnProperty(e)&&eF[e]?(""+t).trim():t+"px"}function e_(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),a=eA(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}Object.keys(eF).forEach(function(e){eN.forEach(function(t){eF[t=t+e.charAt(0).toUpperCase()+e.substring(1)]=eF[e]})});var eD=en({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function eL(e,t){if(t){if(eD[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(f(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(f(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(f(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(f(62))}}function eO(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var eI=null;function eB(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var ez=null,eM=null,eR=null;function ej(e){if(e=rq(e)){if("function"!=typeof ez)throw Error(f(280));var t=e.stateNode;t&&(t=rY(t),ez(e.stateNode,e.type,t))}}function eV(e){eM?eR?eR.push(e):eR=[e]:eM=e}function eU(){if(eM){var e=eM,t=eR;if(eR=eM=null,ej(e),t)for(e=0;e<t.length;e++)ej(t[e])}}function eH(e,t){return e(t)}function eW(){}var eK=!1;function eQ(e,t,n){if(eK)return e(t,n);eK=!0;try{return eH(e,t,n)}finally{eK=!1,(null!==eM||null!==eR)&&(eW(),eU())}}function eX(e,t){var n=e.stateNode;if(null===n)return null;var r=rY(n);if(null===r)return null;switch(n=r[t],t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(f(231,t,typeof n));return n}var eq=!1;if(g)try{var eJ={};Object.defineProperty(eJ,"passive",{get:function(){eq=!0}}),window.addEventListener("test",eJ,eJ),window.removeEventListener("test",eJ,eJ)}catch(e){eq=!1}function eY(e,t,n,r,a,l,o,i,u){var s=Array.prototype.slice.call(arguments,3);try{t.apply(n,s)}catch(e){this.onError(e)}}var eG=!1,eZ=null,e0=!1,e1=null,e2={onError:function(e){eG=!0,eZ=e}};function e3(e,t,n,r,a,l,o,i,u){eG=!1,eZ=null,eY.apply(e2,arguments)}function e4(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do 0!=(4098&(t=e).flags)&&(n=t.return),e=t.return;while(e)}return 3===t.tag?n:null}function e5(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function e8(e){if(e4(e)!==e)throw Error(f(188))}function e6(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=e4(e)))throw Error(f(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(null===a)break;var l=a.alternate;if(null===l){if(null!==(r=a.return)){n=r;continue}break}if(a.child===l.child){for(l=a.child;l;){if(l===n)return e8(a),e;if(l===r)return e8(a),t;l=l.sibling}throw Error(f(188))}if(n.return!==r.return)n=a,r=l;else{for(var o=!1,i=a.child;i;){if(i===n){o=!0,n=a,r=l;break}if(i===r){o=!0,r=a,n=l;break}i=i.sibling}if(!o){for(i=l.child;i;){if(i===n){o=!0,n=l,r=a;break}if(i===r){o=!0,r=l,n=a;break}i=i.sibling}if(!o)throw Error(f(189))}}if(n.alternate!==r)throw Error(f(190))}if(3!==n.tag)throw Error(f(188));return n.stateNode.current===n?e:t}(e))?function e(t){if(5===t.tag||6===t.tag)return t;for(t=t.child;null!==t;){var n=e(t);if(null!==n)return n;t=t.sibling}return null}(e):null}var e7=d.unstable_scheduleCallback,e9=d.unstable_cancelCallback,te=d.unstable_shouldYield,tt=d.unstable_requestPaint,tn=d.unstable_now,tr=d.unstable_getCurrentPriorityLevel,ta=d.unstable_ImmediatePriority,tl=d.unstable_UserBlockingPriority,to=d.unstable_NormalPriority,ti=d.unstable_LowPriority,tu=d.unstable_IdlePriority,ts=null,tc=null,td=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(tf(e)/tp|0)|0},tf=Math.log,tp=Math.LN2,th=64,tm=4194304;function ty(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function tg(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,a=e.suspendedLanes,l=e.pingedLanes,o=268435455&n;if(0!==o){var i=o&~a;0!==i?r=ty(i):0!=(l&=o)&&(r=ty(l))}else 0!=(o=n&~a)?r=ty(o):0!==l&&(r=ty(l));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&a)&&((a=r&-r)>=(l=t&-t)||16===a&&0!=(4194240&l)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)a=1<<(n=31-td(t)),r|=e[n],t&=~a;return r}function tv(e){return 0!=(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function tb(){var e=th;return 0==(4194240&(th<<=1))&&(th=64),e}function tw(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function tk(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-td(t)]=n}function tx(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-td(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var t$=0;function tS(e){return 1<(e&=-e)?4<e?0!=(268435455&e)?16:536870912:4:1}var tE,tC,tP,tT,tF,tN=!1,tA=[],t_=null,tD=null,tL=null,tO=new Map,tI=new Map,tB=[],tz="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function tM(e,t){switch(e){case"focusin":case"focusout":t_=null;break;case"dragenter":case"dragleave":tD=null;break;case"mouseover":case"mouseout":tL=null;break;case"pointerover":case"pointerout":tO.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":tI.delete(t.pointerId)}}function tR(e,t,n,r,a,l){return null===e||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[a]},null!==t&&null!==(t=rq(t))&&tC(t)):(e.eventSystemFlags|=r,t=e.targetContainers,null!==a&&-1===t.indexOf(a)&&t.push(a)),e}function tj(e){var t=rX(e.target);if(null!==t){var n=e4(t);if(null!==n){if(13===(t=n.tag)){if(null!==(t=e5(n))){e.blockedOn=t,tF(e.priority,function(){tP(n)});return}}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=3===n.tag?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function tV(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=tZ(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=rq(n))&&tC(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);eI=r,n.target.dispatchEvent(r),eI=null,t.shift()}return!0}function tU(e,t,n){tV(e)&&n.delete(t)}function tH(){tN=!1,null!==t_&&tV(t_)&&(t_=null),null!==tD&&tV(tD)&&(tD=null),null!==tL&&tV(tL)&&(tL=null),tO.forEach(tU),tI.forEach(tU)}function tW(e,t){e.blockedOn===t&&(e.blockedOn=null,tN||(tN=!0,d.unstable_scheduleCallback(d.unstable_NormalPriority,tH)))}function tK(e){function t(t){return tW(t,e)}if(0<tA.length){tW(tA[0],e);for(var n=1;n<tA.length;n++){var r=tA[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==t_&&tW(t_,e),null!==tD&&tW(tD,e),null!==tL&&tW(tL,e),tO.forEach(t),tI.forEach(t),n=0;n<tB.length;n++)(r=tB[n]).blockedOn===e&&(r.blockedOn=null);for(;0<tB.length&&null===(n=tB[0]).blockedOn;)tj(n),null===n.blockedOn&&tB.shift()}var tQ=P.ReactCurrentBatchConfig,tX=!0;function tq(e,t,n,r){var a=t$,l=tQ.transition;tQ.transition=null;try{t$=1,tY(e,t,n,r)}finally{t$=a,tQ.transition=l}}function tJ(e,t,n,r){var a=t$,l=tQ.transition;tQ.transition=null;try{t$=4,tY(e,t,n,r)}finally{t$=a,tQ.transition=l}}function tY(e,t,n,r){if(tX){var a=tZ(e,t,n,r);if(null===a)rw(e,t,r,tG,n),tM(e,r);else if(function(e,t,n,r,a){switch(t){case"focusin":return t_=tR(t_,e,t,n,r,a),!0;case"dragenter":return tD=tR(tD,e,t,n,r,a),!0;case"mouseover":return tL=tR(tL,e,t,n,r,a),!0;case"pointerover":var l=a.pointerId;return tO.set(l,tR(tO.get(l)||null,e,t,n,r,a)),!0;case"gotpointercapture":return l=a.pointerId,tI.set(l,tR(tI.get(l)||null,e,t,n,r,a)),!0}return!1}(a,e,t,n,r))r.stopPropagation();else if(tM(e,r),4&t&&-1<tz.indexOf(e)){for(;null!==a;){var l=rq(a);if(null!==l&&tE(l),null===(l=tZ(e,t,n,r))&&rw(e,t,r,tG,n),l===a)break;a=l}null!==a&&r.stopPropagation()}else rw(e,t,r,null,n)}}var tG=null;function tZ(e,t,n,r){if(tG=null,null!==(e=rX(e=eB(r)))){if(null===(t=e4(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=e5(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}return tG=e,null}function t0(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(tr()){case ta:return 1;case tl:return 4;case to:case ti:return 16;case tu:return 536870912;default:return 16}default:return 16}}var t1=null,t2=null,t3=null;function t4(){if(t3)return t3;var e,t,n=t2,r=n.length,a="value"in t1?t1.value:t1.textContent,l=a.length;for(e=0;e<r&&n[e]===a[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===a[l-t];t++);return t3=a.slice(e,1<t?1-t:void 0)}function t5(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function t8(){return!0}function t6(){return!1}function t7(e){function t(t,n,r,a,l){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=a,this.target=l,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(a):a[o]);return this.isDefaultPrevented=(null!=a.defaultPrevented?a.defaultPrevented:!1===a.returnValue)?t8:t6,this.isPropagationStopped=t6,this}return en(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=t8)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=t8)},persist:function(){},isPersistent:t8}),t}var t9,ne,nt,nn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nr=t7(nn),na=en({},nn,{view:0,detail:0}),nl=t7(na),no=en({},na,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ng,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==nt&&(nt&&"mousemove"===e.type?(t9=e.screenX-nt.screenX,ne=e.screenY-nt.screenY):ne=t9=0,nt=e),t9)},movementY:function(e){return"movementY"in e?e.movementY:ne}}),ni=t7(no),nu=t7(en({},no,{dataTransfer:0})),ns=t7(en({},na,{relatedTarget:0})),nc=t7(en({},nn,{animationName:0,elapsedTime:0,pseudoElement:0})),nd=t7(en({},nn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),nf=t7(en({},nn,{data:0})),np={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nh={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},nm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ny(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=nm[e])&&!!t[e]}function ng(){return ny}var nv=t7(en({},na,{key:function(e){if(e.key){var t=np[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=t5(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?nh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ng,charCode:function(e){return"keypress"===e.type?t5(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?t5(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),nb=t7(en({},no,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),nw=t7(en({},na,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ng})),nk=t7(en({},nn,{propertyName:0,elapsedTime:0,pseudoElement:0})),nx=t7(en({},no,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),n$=[9,13,27,32],nS=g&&"CompositionEvent"in window,nE=null;g&&"documentMode"in document&&(nE=document.documentMode);var nC=g&&"TextEvent"in window&&!nE,nP=g&&(!nS||nE&&8<nE&&11>=nE),nT=!1;function nF(e,t){switch(e){case"keyup":return -1!==n$.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nN(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var nA=!1,n_={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function nD(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!n_[e.type]:"textarea"===t}function nL(e,t,n,r){eV(r),0<(t=rx(t,"onChange")).length&&(n=new nr("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var nO=null,nI=null;function nB(e){rh(e,0)}function nz(e){if(es(rJ(e)))return e}function nM(e,t){if("change"===e)return t}var nR=!1;if(g){if(g){var nj="oninput"in document;if(!nj){var nV=document.createElement("div");nV.setAttribute("oninput","return;"),nj="function"==typeof nV.oninput}r=nj}else r=!1;nR=r&&(!document.documentMode||9<document.documentMode)}function nU(){nO&&(nO.detachEvent("onpropertychange",nH),nI=nO=null)}function nH(e){if("value"===e.propertyName&&nz(nI)){var t=[];nL(t,nI,e,eB(e)),eQ(nB,t)}}function nW(e,t,n){"focusin"===e?(nU(),nO=t,nI=n,nO.attachEvent("onpropertychange",nH)):"focusout"===e&&nU()}function nK(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return nz(nI)}function nQ(e,t){if("click"===e)return nz(t)}function nX(e,t){if("input"===e||"change"===e)return nz(t)}var nq="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function nJ(e,t){if(nq(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!v.call(t,a)||!nq(e[a],t[a]))return!1}return!0}function nY(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nG(e,t){var n,r=nY(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=nY(r)}}function nZ(){for(var e=window,t=ec();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(n)e=t.contentWindow;else break;t=ec(e.document)}return t}function n0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var n1=g&&"documentMode"in document&&11>=document.documentMode,n2=null,n3=null,n4=null,n5=!1;function n8(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;n5||null==n2||n2!==ec(r)||(r="selectionStart"in(r=n2)&&n0(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},n4&&nJ(n4,r)||(n4=r,0<(r=rx(n3,"onSelect")).length&&(t=new nr("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=n2)))}function n6(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var n7={animationend:n6("Animation","AnimationEnd"),animationiteration:n6("Animation","AnimationIteration"),animationstart:n6("Animation","AnimationStart"),transitionend:n6("Transition","TransitionEnd")},n9={},re={};function rt(e){if(n9[e])return n9[e];if(!n7[e])return e;var t,n=n7[e];for(t in n)if(n.hasOwnProperty(t)&&t in re)return n9[e]=n[t];return e}g&&(re=document.createElement("div").style,"AnimationEvent"in window||(delete n7.animationend.animation,delete n7.animationiteration.animation,delete n7.animationstart.animation),"TransitionEvent"in window||delete n7.transitionend.transition);var rn=rt("animationend"),rr=rt("animationiteration"),ra=rt("animationstart"),rl=rt("transitionend"),ro=new Map,ri="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ru(e,t){ro.set(e,t),m(t,[e])}for(var rs=0;rs<ri.length;rs++){var rc=ri[rs];ru(rc.toLowerCase(),"on"+(rc[0].toUpperCase()+rc.slice(1)))}ru(rn,"onAnimationEnd"),ru(rr,"onAnimationIteration"),ru(ra,"onAnimationStart"),ru("dblclick","onDoubleClick"),ru("focusin","onFocus"),ru("focusout","onBlur"),ru(rl,"onTransitionEnd"),y("onMouseEnter",["mouseout","mouseover"]),y("onMouseLeave",["mouseout","mouseover"]),y("onPointerEnter",["pointerout","pointerover"]),y("onPointerLeave",["pointerout","pointerover"]),m("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),m("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),m("onBeforeInput",["compositionend","keypress","textInput","paste"]),m("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),m("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),m("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),rf=new Set("cancel close invalid load scroll toggle".split(" ").concat(rd));function rp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,a,l,o,i,u){if(e3.apply(this,arguments),eG){if(eG){var s=eZ;eG=!1,eZ=null}else throw Error(f(198));e0||(e0=!0,e1=s)}}(r,t,void 0,e),e.currentTarget=null}function rh(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var l=void 0;if(t)for(var o=r.length-1;0<=o;o--){var i=r[o],u=i.instance,s=i.currentTarget;if(i=i.listener,u!==l&&a.isPropagationStopped())break e;rp(a,i,s),l=u}else for(o=0;o<r.length;o++){if(u=(i=r[o]).instance,s=i.currentTarget,i=i.listener,u!==l&&a.isPropagationStopped())break e;rp(a,i,s),l=u}}}if(e0)throw e=e1,e0=!1,e1=null,e}function rm(e,t){var n=t[rW];void 0===n&&(n=t[rW]=new Set);var r=e+"__bubble";n.has(r)||(rb(t,e,2,!1),n.add(r))}function ry(e,t,n){var r=0;t&&(r|=4),rb(n,e,r,t)}var rg="_reactListening"+Math.random().toString(36).slice(2);function rv(e){if(!e[rg]){e[rg]=!0,p.forEach(function(t){"selectionchange"!==t&&(rf.has(t)||ry(t,!1,e),ry(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[rg]||(t[rg]=!0,ry("selectionchange",!1,t))}}function rb(e,t,n,r){switch(t0(t)){case 1:var a=tq;break;case 4:a=tJ;break;default:a=tY}n=a.bind(null,t,n,e),a=void 0,eq&&("touchstart"===t||"touchmove"===t||"wheel"===t)&&(a=!0),r?void 0!==a?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):void 0!==a?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function rw(e,t,n,r,a){var l=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var i=r.stateNode.containerInfo;if(i===a||8===i.nodeType&&i.parentNode===a)break;if(4===o)for(o=r.return;null!==o;){var u=o.tag;if((3===u||4===u)&&((u=o.stateNode.containerInfo)===a||8===u.nodeType&&u.parentNode===a))return;o=o.return}for(;null!==i;){if(null===(o=rX(i)))return;if(5===(u=o.tag)||6===u){r=l=o;continue e}i=i.parentNode}}r=r.return}eQ(function(){var r=l,a=eB(n),o=[];e:{var i=ro.get(e);if(void 0!==i){var u=nr,s=e;switch(e){case"keypress":if(0===t5(n))break e;case"keydown":case"keyup":u=nv;break;case"focusin":s="focus",u=ns;break;case"focusout":s="blur",u=ns;break;case"beforeblur":case"afterblur":u=ns;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":u=ni;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":u=nu;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":u=nw;break;case rn:case rr:case ra:u=nc;break;case rl:u=nk;break;case"scroll":u=nl;break;case"wheel":u=nx;break;case"copy":case"cut":case"paste":u=nd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":u=nb}var c=0!=(4&t),d=!c&&"scroll"===e,f=c?null!==i?i+"Capture":null:i;c=[];for(var p,h=r;null!==h;){var m=(p=h).stateNode;if(5===p.tag&&null!==m&&(p=m,null!==f&&null!=(m=eX(h,f))&&c.push(rk(h,m,p))),d)break;h=h.return}0<c.length&&(i=new u(i,s,null,n,a),o.push({event:i,listeners:c}))}}if(0==(7&t)){if(i="mouseover"===e||"pointerover"===e,u="mouseout"===e||"pointerout"===e,!(i&&n!==eI&&(s=n.relatedTarget||n.fromElement)&&(rX(s)||s[rH]))&&(u||i)&&(i=a.window===a?a:(i=a.ownerDocument)?i.defaultView||i.parentWindow:window,u?(s=n.relatedTarget||n.toElement,u=r,null!==(s=s?rX(s):null)&&(d=e4(s),s!==d||5!==s.tag&&6!==s.tag)&&(s=null)):(u=null,s=r),u!==s)){if(c=ni,m="onMouseLeave",f="onMouseEnter",h="mouse",("pointerout"===e||"pointerover"===e)&&(c=nb,m="onPointerLeave",f="onPointerEnter",h="pointer"),d=null==u?i:rJ(u),p=null==s?i:rJ(s),(i=new c(m,h+"leave",u,n,a)).target=d,i.relatedTarget=p,m=null,rX(a)===r&&((c=new c(f,h+"enter",s,n,a)).target=p,c.relatedTarget=d,m=c),d=m,u&&s)t:{for(c=u,f=s,h=0,p=c;p;p=r$(p))h++;for(p=0,m=f;m;m=r$(m))p++;for(;0<h-p;)c=r$(c),h--;for(;0<p-h;)f=r$(f),p--;for(;h--;){if(c===f||null!==f&&c===f.alternate)break t;c=r$(c),f=r$(f)}c=null}else c=null;null!==u&&rS(o,i,u,c,!1),null!==s&&null!==d&&rS(o,d,s,c,!0)}e:{if("select"===(u=(i=r?rJ(r):window).nodeName&&i.nodeName.toLowerCase())||"input"===u&&"file"===i.type)var y,g=nM;else if(nD(i)){if(nR)g=nX;else{g=nK;var v=nW}}else(u=i.nodeName)&&"input"===u.toLowerCase()&&("checkbox"===i.type||"radio"===i.type)&&(g=nQ);if(g&&(g=g(e,r))){nL(o,g,n,a);break e}v&&v(e,i,r),"focusout"===e&&(v=i._wrapperState)&&v.controlled&&"number"===i.type&&ey(i,"number",i.value)}switch(v=r?rJ(r):window,e){case"focusin":(nD(v)||"true"===v.contentEditable)&&(n2=v,n3=r,n4=null);break;case"focusout":n4=n3=n2=null;break;case"mousedown":n5=!0;break;case"contextmenu":case"mouseup":case"dragend":n5=!1,n8(o,n,a);break;case"selectionchange":if(n1)break;case"keydown":case"keyup":n8(o,n,a)}if(nS)t:{switch(e){case"compositionstart":var b="onCompositionStart";break t;case"compositionend":b="onCompositionEnd";break t;case"compositionupdate":b="onCompositionUpdate";break t}b=void 0}else nA?nF(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(nP&&"ko"!==n.locale&&(nA||"onCompositionStart"!==b?"onCompositionEnd"===b&&nA&&(y=t4()):(t2="value"in(t1=a)?t1.value:t1.textContent,nA=!0)),0<(v=rx(r,b)).length&&(b=new nf(b,e,null,n,a),o.push({event:b,listeners:v}),y?b.data=y:null!==(y=nN(n))&&(b.data=y))),(y=nC?function(e,t){switch(e){case"compositionend":return nN(t);case"keypress":if(32!==t.which)return null;return nT=!0," ";case"textInput":return" "===(e=t.data)&&nT?null:e;default:return null}}(e,n):function(e,t){if(nA)return"compositionend"===e||!nS&&nF(e,t)?(e=t4(),t3=t2=t1=null,nA=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return nP&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(r=rx(r,"onBeforeInput")).length&&(a=new nf("onBeforeInput","beforeinput",null,n,a),o.push({event:a,listeners:r}),a.data=y)}rh(o,t)})}function rk(e,t,n){return{instance:e,listener:t,currentTarget:n}}function rx(e,t){for(var n=t+"Capture",r=[];null!==e;){var a=e,l=a.stateNode;5===a.tag&&null!==l&&(a=l,null!=(l=eX(e,n))&&r.unshift(rk(e,l,a)),null!=(l=eX(e,t))&&r.push(rk(e,l,a))),e=e.return}return r}function r$(e){if(null===e)return null;do e=e.return;while(e&&5!==e.tag)return e||null}function rS(e,t,n,r,a){for(var l=t._reactName,o=[];null!==n&&n!==r;){var i=n,u=i.alternate,s=i.stateNode;if(null!==u&&u===r)break;5===i.tag&&null!==s&&(i=s,a?null!=(u=eX(n,l))&&o.unshift(rk(n,u,i)):a||null!=(u=eX(n,l))&&o.push(rk(n,u,i))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}var rE=/\r\n?/g,rC=/\u0000|\uFFFD/g;function rP(e){return("string"==typeof e?e:""+e).replace(rE,"\n").replace(rC,"")}function rT(e,t,n){if(t=rP(t),rP(e)!==t&&n)throw Error(f(425))}function rF(){}var rN=null,rA=null;function r_(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var rD="function"==typeof setTimeout?setTimeout:void 0,rL="function"==typeof clearTimeout?clearTimeout:void 0,rO="function"==typeof Promise?Promise:void 0,rI="function"==typeof queueMicrotask?queueMicrotask:void 0!==rO?function(e){return rO.resolve(null).then(e).catch(rB)}:rD;function rB(e){setTimeout(function(){throw e})}function rz(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&8===a.nodeType){if("/$"===(n=a.data)){if(0===r){e.removeChild(a),tK(t);return}r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++}n=a}while(n)tK(t)}function rM(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function rR(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var rj=Math.random().toString(36).slice(2),rV="__reactFiber$"+rj,rU="__reactProps$"+rj,rH="__reactContainer$"+rj,rW="__reactEvents$"+rj,rK="__reactListeners$"+rj,rQ="__reactHandles$"+rj;function rX(e){var t=e[rV];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rH]||n[rV]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=rR(e);null!==e;){if(n=e[rV])return n;e=rR(e)}return t}n=(e=n).parentNode}return null}function rq(e){return(e=e[rV]||e[rH])&&(5===e.tag||6===e.tag||13===e.tag||3===e.tag)?e:null}function rJ(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(f(33))}function rY(e){return e[rU]||null}var rG=[],rZ=-1;function r0(e){return{current:e}}function r1(e){0>rZ||(e.current=rG[rZ],rG[rZ]=null,rZ--)}function r2(e,t){rG[++rZ]=e.current,e.current=t}var r3={},r4=r0(r3),r5=r0(!1),r8=r3;function r6(e,t){var n=e.type.contextTypes;if(!n)return r3;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a,l={};for(a in n)l[a]=t[a];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function r7(e){return null!=(e=e.childContextTypes)}function r9(){r1(r5),r1(r4)}function ae(e,t,n){if(r4.current!==r3)throw Error(f(168));r2(r4,t),r2(r5,n)}function at(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in t))throw Error(f(108,function(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return function e(t){if(null==t)return null;if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case N:return"Fragment";case F:return"Portal";case _:return"Profiler";case A:return"StrictMode";case I:return"Suspense";case B:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case L:return(t.displayName||"Context")+".Consumer";case D:return(t._context.displayName||"Context")+".Provider";case O:var n=t.render;return(t=t.displayName)||(t=""!==(t=n.displayName||n.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case z:return null!==(n=t.displayName||null)?n:e(t.type)||"Memo";case M:n=t._payload,t=t._init;try{return e(t(n))}catch(e){}}return null}(t);case 8:return t===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}(e)||"Unknown",a));return en({},n,r)}function an(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||r3,r8=r4.current,r2(r4,e),r2(r5,r5.current),!0}function ar(e,t,n){var r=e.stateNode;if(!r)throw Error(f(169));n?(e=at(e,t,r8),r.__reactInternalMemoizedMergedChildContext=e,r1(r5),r1(r4),r2(r4,e)):r1(r5),r2(r5,n)}var aa=null,al=!1,ao=!1;function ai(e){null===aa?aa=[e]:aa.push(e)}function au(){if(!ao&&null!==aa){ao=!0;var e=0,t=t$;try{var n=aa;for(t$=1;e<n.length;e++){var r=n[e];do r=r(!0);while(null!==r)}aa=null,al=!1}catch(t){throw null!==aa&&(aa=aa.slice(e+1)),e7(ta,au),t}finally{t$=t,ao=!1}}return null}var as=[],ac=0,ad=null,af=0,ap=[],ah=0,am=null,ay=1,ag="";function av(e,t){as[ac++]=af,as[ac++]=ad,ad=e,af=t}function ab(e,t,n){ap[ah++]=ay,ap[ah++]=ag,ap[ah++]=am,am=e;var r=ay;e=ag;var a=32-td(r)-1;r&=~(1<<a),n+=1;var l=32-td(t)+a;if(30<l){var o=a-a%5;l=(r&(1<<o)-1).toString(32),r>>=o,a-=o,ay=1<<32-td(t)+a|n<<a|r,ag=l+e}else ay=1<<l|n<<a|r,ag=e}function aw(e){null!==e.return&&(av(e,1),ab(e,1,0))}function ak(e){for(;e===ad;)ad=as[--ac],as[ac]=null,af=as[--ac],as[ac]=null;for(;e===am;)am=ap[--ah],ap[ah]=null,ag=ap[--ah],ap[ah]=null,ay=ap[--ah],ap[ah]=null}var ax=null,a$=null,aS=!1,aE=null;function aC(e,t){var n=i6(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function aP(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ax=e,a$=rM(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ax=e,a$=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==am?{id:ay,overflow:ag}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=i6(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ax=e,a$=null,!0);default:return!1}}function aT(e){return 0!=(1&e.mode)&&0==(128&e.flags)}function aF(e){if(aS){var t=a$;if(t){var n=t;if(!aP(e,t)){if(aT(e))throw Error(f(418));t=rM(n.nextSibling);var r=ax;t&&aP(e,t)?aC(r,n):(e.flags=-4097&e.flags|2,aS=!1,ax=e)}}else{if(aT(e))throw Error(f(418));e.flags=-4097&e.flags|2,aS=!1,ax=e}}}function aN(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ax=e}function aA(e){if(e!==ax)return!1;if(!aS)return aN(e),aS=!0,!1;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!r_(e.type,e.memoizedProps)),t&&(t=a$)){if(aT(e))throw a_(),Error(f(418));for(;t;)aC(e,t),t=rM(t.nextSibling)}if(aN(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(f(317));e:{for(t=0,e=e.nextSibling;e;){if(8===e.nodeType){var t,n=e.data;if("/$"===n){if(0===t){a$=rM(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}a$=null}}else a$=ax?rM(e.stateNode.nextSibling):null;return!0}function a_(){for(var e=a$;e;)e=rM(e.nextSibling)}function aD(){a$=ax=null,aS=!1}function aL(e){null===aE?aE=[e]:aE.push(e)}var aO=P.ReactCurrentBatchConfig;function aI(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(f(309));var r=n.stateNode}if(!r)throw Error(f(147,e));var a=r,l=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===l?t.ref:((t=function(e){var t=a.refs;null===e?delete t[l]:t[l]=e})._stringRef=l,t)}if("string"!=typeof e)throw Error(f(284));if(!n._owner)throw Error(f(290,e))}return e}function aB(e,t){throw Error(f(31,"[object Object]"===(e=Object.prototype.toString.call(t))?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function az(e){return(0,e._init)(e._payload)}function aM(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function a(e,t){return(e=i9(e,t)).index=0,e.sibling=null,e}function l(t,n,r){return(t.index=r,e)?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function o(t){return e&&null===t.alternate&&(t.flags|=2),t}function i(e,t,n,r){return null===t||6!==t.tag?(t=ur(n,e.mode,r)).return=e:(t=a(t,n)).return=e,t}function u(e,t,n,r){var l=n.type;return l===N?c(e,t,n.props.children,r,n.key):(null!==t&&(t.elementType===l||"object"==typeof l&&null!==l&&l.$$typeof===M&&az(l)===t.type)?(r=a(t,n.props)).ref=aI(e,t,n):(r=ue(n.type,n.key,n.props,null,e.mode,r)).ref=aI(e,t,n),r.return=e,r)}function s(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ua(n,e.mode,r)).return=e:(t=a(t,n.children||[])).return=e,t}function c(e,t,n,r,l){return null===t||7!==t.tag?(t=ut(n,e.mode,r,l)).return=e:(t=a(t,n)).return=e,t}function d(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=ur(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case T:return(n=ue(t.type,t.key,t.props,null,e.mode,n)).ref=aI(e,null,t),n.return=e,n;case F:return(t=ua(t,e.mode,n)).return=e,t;case M:return d(e,(0,t._init)(t._payload),n)}if(eg(t)||V(t))return(t=ut(t,e.mode,n,null)).return=e,t;aB(e,t)}return null}function p(e,t,n,r){var a=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==a?null:i(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case T:return n.key===a?u(e,t,n,r):null;case F:return n.key===a?s(e,t,n,r):null;case M:return p(e,t,(a=n._init)(n._payload),r)}if(eg(n)||V(n))return null!==a?null:c(e,t,n,r,null);aB(e,n)}return null}function h(e,t,n,r,a){if("string"==typeof r&&""!==r||"number"==typeof r)return i(t,e=e.get(n)||null,""+r,a);if("object"==typeof r&&null!==r){switch(r.$$typeof){case T:return u(t,e=e.get(null===r.key?n:r.key)||null,r,a);case F:return s(t,e=e.get(null===r.key?n:r.key)||null,r,a);case M:return h(e,t,n,(0,r._init)(r._payload),a)}if(eg(r)||V(r))return c(t,e=e.get(n)||null,r,a,null);aB(t,r)}return null}return function i(u,s,c,m){if("object"==typeof c&&null!==c&&c.type===N&&null===c.key&&(c=c.props.children),"object"==typeof c&&null!==c){switch(c.$$typeof){case T:e:{for(var y=c.key,g=s;null!==g;){if(g.key===y){if((y=c.type)===N){if(7===g.tag){n(u,g.sibling),(s=a(g,c.props.children)).return=u,u=s;break e}}else if(g.elementType===y||"object"==typeof y&&null!==y&&y.$$typeof===M&&az(y)===g.type){n(u,g.sibling),(s=a(g,c.props)).ref=aI(u,g,c),s.return=u,u=s;break e}n(u,g);break}t(u,g),g=g.sibling}c.type===N?((s=ut(c.props.children,u.mode,m,c.key)).return=u,u=s):((m=ue(c.type,c.key,c.props,null,u.mode,m)).ref=aI(u,s,c),m.return=u,u=m)}return o(u);case F:e:{for(g=c.key;null!==s;){if(s.key===g){if(4===s.tag&&s.stateNode.containerInfo===c.containerInfo&&s.stateNode.implementation===c.implementation){n(u,s.sibling),(s=a(s,c.children||[])).return=u,u=s;break e}n(u,s);break}t(u,s),s=s.sibling}(s=ua(c,u.mode,m)).return=u,u=s}return o(u);case M:return i(u,s,(g=c._init)(c._payload),m)}if(eg(c))return function(a,o,i,u){for(var s=null,c=null,f=o,m=o=0,y=null;null!==f&&m<i.length;m++){f.index>m?(y=f,f=null):y=f.sibling;var g=p(a,f,i[m],u);if(null===g){null===f&&(f=y);break}e&&f&&null===g.alternate&&t(a,f),o=l(g,o,m),null===c?s=g:c.sibling=g,c=g,f=y}if(m===i.length)return n(a,f),aS&&av(a,m),s;if(null===f){for(;m<i.length;m++)null!==(f=d(a,i[m],u))&&(o=l(f,o,m),null===c?s=f:c.sibling=f,c=f);return aS&&av(a,m),s}for(f=r(a,f);m<i.length;m++)null!==(y=h(f,a,m,i[m],u))&&(e&&null!==y.alternate&&f.delete(null===y.key?m:y.key),o=l(y,o,m),null===c?s=y:c.sibling=y,c=y);return e&&f.forEach(function(e){return t(a,e)}),aS&&av(a,m),s}(u,s,c,m);if(V(c))return function(a,o,i,u){var s=V(i);if("function"!=typeof s)throw Error(f(150));if(null==(i=s.call(i)))throw Error(f(151));for(var c=s=null,m=o,y=o=0,g=null,v=i.next();null!==m&&!v.done;y++,v=i.next()){m.index>y?(g=m,m=null):g=m.sibling;var b=p(a,m,v.value,u);if(null===b){null===m&&(m=g);break}e&&m&&null===b.alternate&&t(a,m),o=l(b,o,y),null===c?s=b:c.sibling=b,c=b,m=g}if(v.done)return n(a,m),aS&&av(a,y),s;if(null===m){for(;!v.done;y++,v=i.next())null!==(v=d(a,v.value,u))&&(o=l(v,o,y),null===c?s=v:c.sibling=v,c=v);return aS&&av(a,y),s}for(m=r(a,m);!v.done;y++,v=i.next())null!==(v=h(m,a,y,v.value,u))&&(e&&null!==v.alternate&&m.delete(null===v.key?y:v.key),o=l(v,o,y),null===c?s=v:c.sibling=v,c=v);return e&&m.forEach(function(e){return t(a,e)}),aS&&av(a,y),s}(u,s,c,m);aB(u,c)}return"string"==typeof c&&""!==c||"number"==typeof c?(c=""+c,null!==s&&6===s.tag?(n(u,s.sibling),(s=a(s,c)).return=u):(n(u,s),(s=ur(c,u.mode,m)).return=u),o(u=s)):n(u,s)}}var aR=aM(!0),aj=aM(!1),aV=r0(null),aU=null,aH=null,aW=null;function aK(){aW=aH=aU=null}function aQ(e){var t=aV.current;r1(aV),e._currentValue=t}function aX(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function aq(e,t){aU=e,aW=aH=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(ov=!0),e.firstContext=null)}function aJ(e){var t=e._currentValue;if(aW!==e){if(e={context:e,memoizedValue:t,next:null},null===aH){if(null===aU)throw Error(f(308));aH=e,aU.dependencies={lanes:0,firstContext:e}}else aH=aH.next=e}return t}var aY=null;function aG(e){null===aY?aY=[e]:aY.push(e)}function aZ(e,t,n,r){var a=t.interleaved;return null===a?(n.next=n,aG(t)):(n.next=a.next,a.next=n),t.interleaved=n,a0(e,r)}function a0(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var a1=!1;function a2(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function a3(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function a4(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function a5(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!=(2&io)){var a=r.pending;return null===a?t.next=t:(t.next=a.next,a.next=t),r.pending=t,a0(e,n)}return null===(a=r.interleaved)?(t.next=t,aG(r)):(t.next=a.next,a.next=t),r.interleaved=t,a0(e,n)}function a8(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194240&n))){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tx(e,n)}}function a6(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var a=null,l=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===l?a=l=o:l=l.next=o,n=n.next}while(null!==n)null===l?a=l=t:l=l.next=t}else a=l=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function a7(e,t,n,r){var a=e.updateQueue;a1=!1;var l=a.firstBaseUpdate,o=a.lastBaseUpdate,i=a.shared.pending;if(null!==i){a.shared.pending=null;var u=i,s=u.next;u.next=null,null===o?l=s:o.next=s,o=u;var c=e.alternate;null!==c&&(i=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===i?c.firstBaseUpdate=s:i.next=s,c.lastBaseUpdate=u)}if(null!==l){var d=a.baseState;for(o=0,c=s=u=null,i=l;;){var f=i.lane,p=i.eventTime;if((r&f)===f){null!==c&&(c=c.next={eventTime:p,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var h=e,m=i;switch(f=t,p=n,m.tag){case 1:if("function"==typeof(h=m.payload)){d=h.call(p,d,f);break e}d=h;break e;case 3:h.flags=-65537&h.flags|128;case 0:if(null==(f="function"==typeof(h=m.payload)?h.call(p,d,f):h))break e;d=en({},d,f);break e;case 2:a1=!0}}null!==i.callback&&0!==i.lane&&(e.flags|=64,null===(f=a.effects)?a.effects=[i]:f.push(i))}else p={eventTime:p,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},null===c?(s=c=p,u=d):c=c.next=p,o|=f;if(null===(i=i.next)){if(null===(i=a.shared.pending))break;i=(f=i).next,f.next=null,a.lastBaseUpdate=f,a.shared.pending=null}}if(null===c&&(u=d),a.baseState=u,a.firstBaseUpdate=s,a.lastBaseUpdate=c,null!==(t=a.shared.interleaved)){a=t;do o|=a.lane,a=a.next;while(a!==t)}else null===l&&(a.shared.lanes=0);im|=o,e.lanes=o,e.memoizedState=d}}function a9(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(null!==a){if(r.callback=null,r=n,"function"!=typeof a)throw Error(f(191,a));a.call(r)}}}var le={},lt=r0(le),ln=r0(le),lr=r0(le);function la(e){if(e===le)throw Error(f(174));return e}function ll(e,t){switch(r2(lr,t),r2(ln,e),r2(lt,le),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:eS(null,"");break;default:t=eS(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}r1(lt),r2(lt,t)}function lo(){r1(lt),r1(ln),r1(lr)}function li(e){la(lr.current);var t=la(lt.current),n=eS(t,e.type);t!==n&&(r2(ln,e),r2(lt,n))}function lu(e){ln.current===e&&(r1(lt),r1(ln))}var ls=r0(0);function lc(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ld=[];function lf(){for(var e=0;e<ld.length;e++)ld[e]._workInProgressVersionPrimary=null;ld.length=0}var lp=P.ReactCurrentDispatcher,lh=P.ReactCurrentBatchConfig,lm=0,ly=null,lg=null,lv=null,lb=!1,lw=!1,lk=0,lx=0;function l$(){throw Error(f(321))}function lS(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!nq(e[n],t[n]))return!1;return!0}function lE(e,t,n,r,a,l){if(lm=l,ly=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,lp.current=null===e||null===e.memoizedState?l7:l9,e=n(r,a),lw){l=0;do{if(lw=!1,lk=0,25<=l)throw Error(f(301));l+=1,lv=lg=null,t.updateQueue=null,lp.current=oe,e=n(r,a)}while(lw)}if(lp.current=l6,t=null!==lg&&null!==lg.next,lm=0,lv=lg=ly=null,lb=!1,t)throw Error(f(300));return e}function lC(){var e=0!==lk;return lk=0,e}function lP(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===lv?ly.memoizedState=lv=e:lv=lv.next=e,lv}function lT(){if(null===lg){var e=ly.alternate;e=null!==e?e.memoizedState:null}else e=lg.next;var t=null===lv?ly.memoizedState:lv.next;if(null!==t)lv=t,lg=e;else{if(null===e)throw Error(f(310));e={memoizedState:(lg=e).memoizedState,baseState:lg.baseState,baseQueue:lg.baseQueue,queue:lg.queue,next:null},null===lv?ly.memoizedState=lv=e:lv=lv.next=e}return lv}function lF(e,t){return"function"==typeof t?t(e):t}function lN(e){var t=lT(),n=t.queue;if(null===n)throw Error(f(311));n.lastRenderedReducer=e;var r=lg,a=r.baseQueue,l=n.pending;if(null!==l){if(null!==a){var o=a.next;a.next=l.next,l.next=o}r.baseQueue=a=l,n.pending=null}if(null!==a){l=a.next,r=r.baseState;var i=o=null,u=null,s=l;do{var c=s.lane;if((lm&c)===c)null!==u&&(u=u.next={lane:0,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null}),r=s.hasEagerState?s.eagerState:e(r,s.action);else{var d={lane:c,action:s.action,hasEagerState:s.hasEagerState,eagerState:s.eagerState,next:null};null===u?(i=u=d,o=r):u=u.next=d,ly.lanes|=c,im|=c}s=s.next}while(null!==s&&s!==l)null===u?o=r:u.next=i,nq(r,t.memoizedState)||(ov=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=u,n.lastRenderedState=r}if(null!==(e=n.interleaved)){a=e;do l=a.lane,ly.lanes|=l,im|=l,a=a.next;while(a!==e)}else null===a&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function lA(e){var t=lT(),n=t.queue;if(null===n)throw Error(f(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,l=t.memoizedState;if(null!==a){n.pending=null;var o=a=a.next;do l=e(l,o.action),o=o.next;while(o!==a)nq(l,t.memoizedState)||(ov=!0),t.memoizedState=l,null===t.baseQueue&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function l_(){}function lD(e,t){var n=ly,r=lT(),a=t(),l=!nq(r.memoizedState,a);if(l&&(r.memoizedState=a,ov=!0),r=r.queue,lW(lI.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||null!==lv&&1&lv.memoizedState.tag){if(n.flags|=2048,lR(9,lO.bind(null,n,r,a,t),void 0,null),null===ii)throw Error(f(349));0!=(30&lm)||lL(n,t,a)}return a}function lL(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ly.updateQueue)?(t={lastEffect:null,stores:null},ly.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function lO(e,t,n,r){t.value=n,t.getSnapshot=r,lB(t)&&lz(e)}function lI(e,t,n){return n(function(){lB(t)&&lz(e)})}function lB(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!nq(e,n)}catch(e){return!0}}function lz(e){var t=a0(e,1);null!==t&&iO(t,e,1,-1)}function lM(e){var t=lP();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:lF,lastRenderedState:e},t.queue=e,e=e.dispatch=l3.bind(null,ly,e),[t.memoizedState,e]}function lR(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ly.updateQueue)?(t={lastEffect:null,stores:null},ly.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function lj(){return lT().memoizedState}function lV(e,t,n,r){var a=lP();ly.flags|=e,a.memoizedState=lR(1|t,n,void 0,void 0===r?null:r)}function lU(e,t,n,r){var a=lT();r=void 0===r?null:r;var l=void 0;if(null!==lg){var o=lg.memoizedState;if(l=o.destroy,null!==r&&lS(r,o.deps)){a.memoizedState=lR(t,n,l,r);return}}ly.flags|=e,a.memoizedState=lR(1|t,n,l,r)}function lH(e,t){return lV(8390656,8,e,t)}function lW(e,t){return lU(2048,8,e,t)}function lK(e,t){return lU(4,2,e,t)}function lQ(e,t){return lU(4,4,e,t)}function lX(e,t){return"function"==typeof t?(t(e=e()),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function lq(e,t,n){return n=null!=n?n.concat([e]):null,lU(4,4,lX.bind(null,t,e),n)}function lJ(){}function lY(e,t){var n=lT();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&lS(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function lG(e,t){var n=lT();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&lS(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function lZ(e,t,n){return 0==(21&lm)?(e.baseState&&(e.baseState=!1,ov=!0),e.memoizedState=n):(nq(n,t)||(n=tb(),ly.lanes|=n,im|=n,e.baseState=!0),t)}function l0(e,t){var n=t$;t$=0!==n&&4>n?n:4,e(!0);var r=lh.transition;lh.transition={};try{e(!1),t()}finally{t$=n,lh.transition=r}}function l1(){return lT().memoizedState}function l2(e,t,n){var r=iL(e);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},l4(e)?l5(t,n):null!==(n=aZ(e,t,n,r))&&(iO(n,e,r,iD()),l8(n,t,r))}function l3(e,t,n){var r=iL(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(l4(e))l5(t,a);else{var l=e.alternate;if(0===e.lanes&&(null===l||0===l.lanes)&&null!==(l=t.lastRenderedReducer))try{var o=t.lastRenderedState,i=l(o,n);if(a.hasEagerState=!0,a.eagerState=i,nq(i,o)){var u=t.interleaved;null===u?(a.next=a,aG(t)):(a.next=u.next,u.next=a),t.interleaved=a;return}}catch(e){}finally{}null!==(n=aZ(e,t,a,r))&&(iO(n,e,r,a=iD()),l8(n,t,r))}}function l4(e){var t=e.alternate;return e===ly||null!==t&&t===ly}function l5(e,t){lw=lb=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function l8(e,t,n){if(0!=(4194240&n)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tx(e,n)}}var l6={readContext:aJ,useCallback:l$,useContext:l$,useEffect:l$,useImperativeHandle:l$,useInsertionEffect:l$,useLayoutEffect:l$,useMemo:l$,useReducer:l$,useRef:l$,useState:l$,useDebugValue:l$,useDeferredValue:l$,useTransition:l$,useMutableSource:l$,useSyncExternalStore:l$,useId:l$,unstable_isNewReconciler:!1},l7={readContext:aJ,useCallback:function(e,t){return lP().memoizedState=[e,void 0===t?null:t],e},useContext:aJ,useEffect:lH,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,lV(4194308,4,lX.bind(null,t,e),n)},useLayoutEffect:function(e,t){return lV(4194308,4,e,t)},useInsertionEffect:function(e,t){return lV(4,2,e,t)},useMemo:function(e,t){var n=lP();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=lP();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=l2.bind(null,ly,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},lP().memoizedState=e},useState:lM,useDebugValue:lJ,useDeferredValue:function(e){return lP().memoizedState=e},useTransition:function(){var e=lM(!1),t=e[0];return e=l0.bind(null,e[1]),lP().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ly,a=lP();if(aS){if(void 0===n)throw Error(f(407));n=n()}else{if(n=t(),null===ii)throw Error(f(349));0!=(30&lm)||lL(r,t,n)}a.memoizedState=n;var l={value:n,getSnapshot:t};return a.queue=l,lH(lI.bind(null,r,l,e),[e]),r.flags|=2048,lR(9,lO.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=lP(),t=ii.identifierPrefix;if(aS){var n=ag,r=ay;t=":"+t+"R"+(n=(r&~(1<<32-td(r)-1)).toString(32)+n),0<(n=lk++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=lx++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},l9={readContext:aJ,useCallback:lY,useContext:aJ,useEffect:lW,useImperativeHandle:lq,useInsertionEffect:lK,useLayoutEffect:lQ,useMemo:lG,useReducer:lN,useRef:lj,useState:function(){return lN(lF)},useDebugValue:lJ,useDeferredValue:function(e){return lZ(lT(),lg.memoizedState,e)},useTransition:function(){return[lN(lF)[0],lT().memoizedState]},useMutableSource:l_,useSyncExternalStore:lD,useId:l1,unstable_isNewReconciler:!1},oe={readContext:aJ,useCallback:lY,useContext:aJ,useEffect:lW,useImperativeHandle:lq,useInsertionEffect:lK,useLayoutEffect:lQ,useMemo:lG,useReducer:lA,useRef:lj,useState:function(){return lA(lF)},useDebugValue:lJ,useDeferredValue:function(e){var t=lT();return null===lg?t.memoizedState=e:lZ(t,lg.memoizedState,e)},useTransition:function(){return[lA(lF)[0],lT().memoizedState]},useMutableSource:l_,useSyncExternalStore:lD,useId:l1,unstable_isNewReconciler:!1};function ot(e,t){if(e&&e.defaultProps)for(var n in t=en({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}function on(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:en({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var or={isMounted:function(e){return!!(e=e._reactInternals)&&e4(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=iD(),a=iL(e),l=a4(r,a);l.payload=t,null!=n&&(l.callback=n),null!==(t=a5(e,l,a))&&(iO(t,e,a,r),a8(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=iD(),a=iL(e),l=a4(r,a);l.tag=1,l.payload=t,null!=n&&(l.callback=n),null!==(t=a5(e,l,a))&&(iO(t,e,a,r),a8(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=iD(),r=iL(e),a=a4(n,r);a.tag=2,null!=t&&(a.callback=t),null!==(t=a5(e,a,r))&&(iO(t,e,r,n),a8(t,e,r))}};function oa(e,t,n,r,a,l,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,l,o):!t.prototype||!t.prototype.isPureReactComponent||!nJ(n,r)||!nJ(a,l)}function ol(e,t,n){var r=!1,a=r3,l=t.contextType;return"object"==typeof l&&null!==l?l=aJ(l):(a=r7(t)?r8:r4.current,l=(r=null!=(r=t.contextTypes))?r6(e,a):r3),t=new t(n,l),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=or,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=l),t}function oo(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&or.enqueueReplaceState(t,t.state,null)}function oi(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},a2(e);var l=t.contextType;"object"==typeof l&&null!==l?a.context=aJ(l):(l=r7(t)?r8:r4.current,a.context=r6(e,l)),a.state=e.memoizedState,"function"==typeof(l=t.getDerivedStateFromProps)&&(on(e,t,l,n),a.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof a.getSnapshotBeforeUpdate||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||(t=a.state,"function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),t!==a.state&&or.enqueueReplaceState(a,a.state,null),a7(e,n,a,r),a.state=e.memoizedState),"function"==typeof a.componentDidMount&&(e.flags|=4194308)}function ou(e,t){try{var n="",r=t;do n+=function(e){switch(e.tag){case 5:return er(e.type);case 16:return er("Lazy");case 13:return er("Suspense");case 19:return er("SuspenseList");case 0:case 2:case 15:return e=el(e.type,!1);case 11:return e=el(e.type.render,!1);case 1:return e=el(e.type,!0);default:return""}}(r),r=r.return;while(r)var a=n}catch(e){a="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:a,digest:null}}function os(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function oc(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var od="function"==typeof WeakMap?WeakMap:Map;function of(e,t,n){(n=a4(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){i$||(i$=!0,iS=r),oc(e,t)},n}function op(e,t,n){(n=a4(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){oc(e,t)}}var l=e.stateNode;return null!==l&&"function"==typeof l.componentDidCatch&&(n.callback=function(){oc(e,t),"function"!=typeof r&&(null===iE?iE=new Set([this]):iE.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}function oh(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new od;var a=new Set;r.set(t,a)}else void 0===(a=r.get(t))&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=i2.bind(null,e,t,n),t.then(e,e))}function om(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e)return null}function oy(e,t,n,r,a){return 0==(1&e.mode)?e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=a4(-1,1)).tag=2,a5(n,t,1))),n.lanes|=1):(e.flags|=65536,e.lanes=a),e}var og=P.ReactCurrentOwner,ov=!1;function ob(e,t,n,r){t.child=null===e?aj(t,null,n,r):aR(t,e.child,n,r)}function ow(e,t,n,r,a){n=n.render;var l=t.ref;return(aq(t,a),r=lE(e,t,n,r,l,a),n=lC(),null===e||ov)?(aS&&n&&aw(t),t.flags|=1,ob(e,t,r,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,oM(e,t,a))}function ok(e,t,n,r,a){if(null===e){var l=n.type;return"function"!=typeof l||i7(l)||void 0!==l.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=ue(n.type,null,r,t,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=l,ox(e,t,l,r,a))}if(l=e.child,0==(e.lanes&a)){var o=l.memoizedProps;if((n=null!==(n=n.compare)?n:nJ)(o,r)&&e.ref===t.ref)return oM(e,t,a)}return t.flags|=1,(e=i9(l,r)).ref=t.ref,e.return=t,t.child=e}function ox(e,t,n,r,a){if(null!==e){var l=e.memoizedProps;if(nJ(l,r)&&e.ref===t.ref){if(ov=!1,t.pendingProps=r=l,0==(e.lanes&a))return t.lanes=e.lanes,oM(e,t,a);0!=(131072&e.flags)&&(ov=!0)}}return oE(e,t,n,r,a)}function o$(e,t,n){var r=t.pendingProps,a=r.children,l=null!==e?e.memoizedState:null;if("hidden"===r.mode){if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r2(id,ic),ic|=n;else{if(0==(1073741824&n))return e=null!==l?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,r2(id,ic),ic|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==l?l.baseLanes:n,r2(id,ic),ic|=r}}else null!==l?(r=l.baseLanes|n,t.memoizedState=null):r=n,r2(id,ic),ic|=r;return ob(e,t,a,n),t.child}function oS(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function oE(e,t,n,r,a){var l=r7(n)?r8:r4.current;return(l=r6(t,l),aq(t,a),n=lE(e,t,n,r,l,a),r=lC(),null===e||ov)?(aS&&r&&aw(t),t.flags|=1,ob(e,t,n,a),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,oM(e,t,a))}function oC(e,t,n,r,a){if(r7(n)){var l=!0;an(t)}else l=!1;if(aq(t,a),null===t.stateNode)oz(e,t),ol(t,n,r),oi(t,n,r,a),r=!0;else if(null===e){var o=t.stateNode,i=t.memoizedProps;o.props=i;var u=o.context,s=n.contextType;s="object"==typeof s&&null!==s?aJ(s):r6(t,s=r7(n)?r8:r4.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof o.getSnapshotBeforeUpdate;d||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(i!==r||u!==s)&&oo(t,o,r,s),a1=!1;var f=t.memoizedState;o.state=f,a7(t,r,o,a),u=t.memoizedState,i!==r||f!==u||r5.current||a1?("function"==typeof c&&(on(t,n,c,r),u=t.memoizedState),(i=a1||oa(t,n,i,r,f,u,s))?(d||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4194308)):("function"==typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=s,r=i):("function"==typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,a3(e,t),i=t.memoizedProps,s=t.type===t.elementType?i:ot(t.type,i),o.props=s,d=t.pendingProps,f=o.context,u="object"==typeof(u=n.contextType)&&null!==u?aJ(u):r6(t,u=r7(n)?r8:r4.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(i!==d||f!==u)&&oo(t,o,r,u),a1=!1,f=t.memoizedState,o.state=f,a7(t,r,o,a);var h=t.memoizedState;i!==d||f!==h||r5.current||a1?("function"==typeof p&&(on(t,n,p,r),h=t.memoizedState),(s=a1||oa(t,n,s,r,f,h,u)||!1)?(c||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,h,u),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,h,u)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof o.componentDidUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),o.props=r,o.state=h,o.context=u,r=s):("function"!=typeof o.componentDidUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return oP(e,t,n,r,l,a)}function oP(e,t,n,r,a,l){oS(e,t);var o=0!=(128&t.flags);if(!r&&!o)return a&&ar(t,n,!1),oM(e,t,l);r=t.stateNode,og.current=t;var i=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=aR(t,e.child,null,l),t.child=aR(t,null,i,l)):ob(e,t,i,l),t.memoizedState=r.state,a&&ar(t,n,!0),t.child}function oT(e){var t=e.stateNode;t.pendingContext?ae(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ae(e,t.context,!1),ll(e,t.containerInfo)}function oF(e,t,n,r,a){return aD(),aL(a),t.flags|=256,ob(e,t,n,r),t.child}var oN={dehydrated:null,treeContext:null,retryLane:0};function oA(e){return{baseLanes:e,cachePool:null,transitions:null}}function o_(e,t,n){var r,a=t.pendingProps,l=ls.current,o=!1,i=0!=(128&t.flags);if((r=i)||(r=(null===e||null!==e.memoizedState)&&0!=(2&l)),r?(o=!0,t.flags&=-129):(null===e||null!==e.memoizedState)&&(l|=1),r2(ls,1&l),null===e)return(aF(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated))?(0==(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(i=a.children,e=a.fallback,o?(a=t.mode,o=t.child,i={mode:"hidden",children:i},0==(1&a)&&null!==o?(o.childLanes=0,o.pendingProps=i):o=un(i,a,0,null),e=ut(e,a,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=oA(n),t.memoizedState=oN,e):oD(t,i));if(null!==(l=e.memoizedState)&&null!==(r=l.dehydrated))return function(e,t,n,r,a,l,o){if(n)return 256&t.flags?(t.flags&=-257,oL(e,t,o,r=os(Error(f(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(l=r.fallback,a=t.mode,r=un({mode:"visible",children:r.children},a,0,null),l=ut(l,a,o,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,0!=(1&t.mode)&&aR(t,e.child,null,o),t.child.memoizedState=oA(o),t.memoizedState=oN,l);if(0==(1&t.mode))return oL(e,t,o,null);if("$!"===a.data){if(r=a.nextSibling&&a.nextSibling.dataset)var i=r.dgst;return r=i,oL(e,t,o,r=os(l=Error(f(419)),r,void 0))}if(i=0!=(o&e.childLanes),ov||i){if(null!==(r=ii)){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}0!==(a=0!=(a&(r.suspendedLanes|o))?0:a)&&a!==l.retryLane&&(l.retryLane=a,a0(e,a),iO(r,e,a,-1))}return iX(),oL(e,t,o,r=os(Error(f(421))))}return"$?"===a.data?(t.flags|=128,t.child=e.child,t=i4.bind(null,e),a._reactRetry=t,null):(e=l.treeContext,a$=rM(a.nextSibling),ax=t,aS=!0,aE=null,null!==e&&(ap[ah++]=ay,ap[ah++]=ag,ap[ah++]=am,ay=e.id,ag=e.overflow,am=t),t=oD(t,r.children),t.flags|=4096,t)}(e,t,i,a,r,l,n);if(o){o=a.fallback,i=t.mode,r=(l=e.child).sibling;var u={mode:"hidden",children:a.children};return 0==(1&i)&&t.child!==l?((a=t.child).childLanes=0,a.pendingProps=u,t.deletions=null):(a=i9(l,u)).subtreeFlags=14680064&l.subtreeFlags,null!==r?o=i9(r,o):(o=ut(o,i,n,null),o.flags|=2),o.return=t,a.return=t,a.sibling=o,t.child=a,a=o,o=t.child,i=null===(i=e.child.memoizedState)?oA(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=oN,a}return e=(o=e.child).sibling,a=i9(o,{mode:"visible",children:a.children}),0==(1&t.mode)&&(a.lanes=n),a.return=t,a.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=a,t.memoizedState=null,a}function oD(e,t){return(t=un({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function oL(e,t,n,r){return null!==r&&aL(r),aR(t,e.child,null,n),e=oD(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function oO(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),aX(e.return,t,n)}function oI(e,t,n,r,a){var l=e.memoizedState;null===l?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=a)}function oB(e,t,n){var r=t.pendingProps,a=r.revealOrder,l=r.tail;if(ob(e,t,r.children,n),0!=(2&(r=ls.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&oO(e,n,t);else if(19===e.tag)oO(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(r2(ls,r),0==(1&t.mode))t.memoizedState=null;else switch(a){case"forwards":for(a=null,n=t.child;null!==n;)null!==(e=n.alternate)&&null===lc(e)&&(a=n),n=n.sibling;null===(n=a)?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),oI(t,!1,a,n,l);break;case"backwards":for(n=null,a=t.child,t.child=null;null!==a;){if(null!==(e=a.alternate)&&null===lc(e)){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}oI(t,!0,n,null,l);break;case"together":oI(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function oz(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function oM(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),im|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(f(153));if(null!==t.child){for(n=i9(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=i9(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function oR(e,t){if(!aS)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function oj(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=14680064&a.subtreeFlags,r|=14680064&a.flags,a.return=e,a=a.sibling;else for(a=e.child;null!==a;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}a=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},o=function(){},i=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,la(lt.current);var l,o=null;switch(n){case"input":a=ed(e,a),r=ed(e,r),o=[];break;case"select":a=en({},a,{value:void 0}),r=en({},r,{value:void 0}),o=[];break;case"textarea":a=eb(e,a),r=eb(e,r),o=[];break;default:"function"!=typeof a.onClick&&"function"==typeof r.onClick&&(e.onclick=rF)}for(s in eL(n,r),n=null,a)if(!r.hasOwnProperty(s)&&a.hasOwnProperty(s)&&null!=a[s]){if("style"===s){var i=a[s];for(l in i)i.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else"dangerouslySetInnerHTML"!==s&&"children"!==s&&"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(h.hasOwnProperty(s)?o||(o=[]):(o=o||[]).push(s,null))}for(s in r){var u=r[s];if(i=null!=a?a[s]:void 0,r.hasOwnProperty(s)&&u!==i&&(null!=u||null!=i)){if("style"===s){if(i){for(l in i)!i.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in u)u.hasOwnProperty(l)&&i[l]!==u[l]&&(n||(n={}),n[l]=u[l])}else n||(o||(o=[]),o.push(s,n)),n=u}else"dangerouslySetInnerHTML"===s?(u=u?u.__html:void 0,i=i?i.__html:void 0,null!=u&&i!==u&&(o=o||[]).push(s,u)):"children"===s?"string"!=typeof u&&"number"!=typeof u||(o=o||[]).push(s,""+u):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&(h.hasOwnProperty(s)?(null!=u&&"onScroll"===s&&rm("scroll",e),o||i===u||(o=[])):(o=o||[]).push(s,u))}}n&&(o=o||[]).push("style",n);var s=o;(t.updateQueue=s)&&(t.flags|=4)}},u=function(e,t,n,r){n!==r&&(t.flags|=4)};var oV=!1,oU=!1,oH="function"==typeof WeakSet?WeakSet:Set,oW=null;function oK(e,t){var n=e.ref;if(null!==n){if("function"==typeof n)try{n(null)}catch(n){i1(e,t,n)}else n.current=null}}function oQ(e,t,n){try{n()}catch(n){i1(e,t,n)}}var oX=!1;function oq(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var a=r=r.next;do{if((a.tag&e)===e){var l=a.destroy;a.destroy=void 0,void 0!==l&&oQ(t,n,l)}a=a.next}while(a!==r)}}function oJ(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function oY(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function oG(e){return 5===e.tag||3===e.tag||4===e.tag}function oZ(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||oG(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags||null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}var o0=null,o1=!1;function o2(e,t,n){for(n=n.child;null!==n;)o3(e,t,n),n=n.sibling}function o3(e,t,n){if(tc&&"function"==typeof tc.onCommitFiberUnmount)try{tc.onCommitFiberUnmount(ts,n)}catch(e){}switch(n.tag){case 5:oU||oK(n,t);case 6:var r=o0,a=o1;o0=null,o2(e,t,n),o0=r,o1=a,null!==o0&&(o1?(e=o0,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):o0.removeChild(n.stateNode));break;case 18:null!==o0&&(o1?(e=o0,n=n.stateNode,8===e.nodeType?rz(e.parentNode,n):1===e.nodeType&&rz(e,n),tK(e)):rz(o0,n.stateNode));break;case 4:r=o0,a=o1,o0=n.stateNode.containerInfo,o1=!0,o2(e,t,n),o0=r,o1=a;break;case 0:case 11:case 14:case 15:if(!oU&&null!==(r=n.updateQueue)&&null!==(r=r.lastEffect)){a=r=r.next;do{var l=a,o=l.destroy;l=l.tag,void 0!==o&&(0!=(2&l)?oQ(n,t,o):0!=(4&l)&&oQ(n,t,o)),a=a.next}while(a!==r)}o2(e,t,n);break;case 1:if(!oU&&(oK(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){i1(n,t,e)}o2(e,t,n);break;case 21:default:o2(e,t,n);break;case 22:1&n.mode?(oU=(r=oU)||null!==n.memoizedState,o2(e,t,n),oU=r):o2(e,t,n)}}function o4(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new oH),t.forEach(function(t){var r=i5.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function o5(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var a=n[r];try{var l=t,o=l;e:for(;null!==o;){switch(o.tag){case 5:o0=o.stateNode,o1=!1;break e;case 3:case 4:o0=o.stateNode.containerInfo,o1=!0;break e}o=o.return}if(null===o0)throw Error(f(160));o3(e,l,a),o0=null,o1=!1;var i=a.alternate;null!==i&&(i.return=null),a.return=null}catch(e){i1(a,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)o8(t,e),t=t.sibling}function o8(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(o5(t,e),o6(e),4&r){try{oq(3,e,e.return),oJ(3,e)}catch(t){i1(e,e.return,t)}try{oq(5,e,e.return)}catch(t){i1(e,e.return,t)}}break;case 1:o5(t,e),o6(e),512&r&&null!==n&&oK(n,n.return);break;case 5:if(o5(t,e),o6(e),512&r&&null!==n&&oK(n,n.return),32&e.flags){var a=e.stateNode;try{eT(a,"")}catch(t){i1(e,e.return,t)}}if(4&r&&null!=(a=e.stateNode)){var l=e.memoizedProps,o=null!==n?n.memoizedProps:l,i=e.type,u=e.updateQueue;if(e.updateQueue=null,null!==u)try{"input"===i&&"radio"===l.type&&null!=l.name&&ep(a,l),eO(i,o);var s=eO(i,l);for(o=0;o<u.length;o+=2){var c=u[o],d=u[o+1];"style"===c?e_(a,d):"dangerouslySetInnerHTML"===c?eP(a,d):"children"===c?eT(a,d):C(a,c,d,s)}switch(i){case"input":eh(a,l);break;case"textarea":ek(a,l);break;case"select":var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!l.multiple;var h=l.value;null!=h?ev(a,!!l.multiple,h,!1):!!l.multiple!==p&&(null!=l.defaultValue?ev(a,!!l.multiple,l.defaultValue,!0):ev(a,!!l.multiple,l.multiple?[]:"",!1))}a[rU]=l}catch(t){i1(e,e.return,t)}}break;case 6:if(o5(t,e),o6(e),4&r){if(null===e.stateNode)throw Error(f(162));a=e.stateNode,l=e.memoizedProps;try{a.nodeValue=l}catch(t){i1(e,e.return,t)}}break;case 3:if(o5(t,e),o6(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{tK(t.containerInfo)}catch(t){i1(e,e.return,t)}break;case 4:default:o5(t,e),o6(e);break;case 13:o5(t,e),o6(e),8192&(a=e.child).flags&&(l=null!==a.memoizedState,a.stateNode.isHidden=l,l&&(null===a.alternate||null===a.alternate.memoizedState)&&(iw=tn())),4&r&&o4(e);break;case 22:if(c=null!==n&&null!==n.memoizedState,1&e.mode?(oU=(s=oU)||c,o5(t,e),oU=s):o5(t,e),o6(e),8192&r){if(s=null!==e.memoizedState,(e.stateNode.isHidden=s)&&!c&&0!=(1&e.mode))for(oW=e,c=e.child;null!==c;){for(d=oW=c;null!==oW;){switch(h=(p=oW).child,p.tag){case 0:case 11:case 14:case 15:oq(4,p,p.return);break;case 1:oK(p,p.return);var m=p.stateNode;if("function"==typeof m.componentWillUnmount){r=p,n=p.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(e){i1(r,n,e)}}break;case 5:oK(p,p.return);break;case 22:if(null!==p.memoizedState){o9(d);continue}}null!==h?(h.return=p,oW=h):o9(d)}c=c.sibling}e:for(c=null,d=e;;){if(5===d.tag){if(null===c){c=d;try{a=d.stateNode,s?(l=a.style,"function"==typeof l.setProperty?l.setProperty("display","none","important"):l.display="none"):(i=d.stateNode,o=null!=(u=d.memoizedProps.style)&&u.hasOwnProperty("display")?u.display:null,i.style.display=eA("display",o))}catch(t){i1(e,e.return,t)}}}else if(6===d.tag){if(null===c)try{d.stateNode.nodeValue=s?"":d.memoizedProps}catch(t){i1(e,e.return,t)}}else if((22!==d.tag&&23!==d.tag||null===d.memoizedState||d===e)&&null!==d.child){d.child.return=d,d=d.child;continue}if(d===e)break;for(;null===d.sibling;){if(null===d.return||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:o5(t,e),o6(e),4&r&&o4(e);case 21:}}function o6(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(oG(n)){var r=n;break e}n=n.return}throw Error(f(160))}switch(r.tag){case 5:var a=r.stateNode;32&r.flags&&(eT(a,""),r.flags&=-33);var l=oZ(e);!function e(t,n,r){var a=t.tag;if(5===a||6===a)t=t.stateNode,n?r.insertBefore(t,n):r.appendChild(t);else if(4!==a&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,l,a);break;case 3:case 4:var o=r.stateNode.containerInfo,i=oZ(e);!function e(t,n,r){var a=t.tag;if(5===a||6===a)t=t.stateNode,n?8===r.nodeType?r.parentNode.insertBefore(t,n):r.insertBefore(t,n):(8===r.nodeType?(n=r.parentNode).insertBefore(t,r):(n=r).appendChild(t),null!=(r=r._reactRootContainer)||null!==n.onclick||(n.onclick=rF));else if(4!==a&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,i,o);break;default:throw Error(f(161))}}catch(t){i1(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function o7(e){for(;null!==oW;){var t=oW;if(0!=(8772&t.flags)){var n=t.alternate;try{if(0!=(8772&t.flags))switch(t.tag){case 0:case 11:case 15:oU||oJ(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!oU){if(null===n)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:ot(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}}var l=t.updateQueue;null!==l&&a9(t,l,r);break;case 3:var o=t.updateQueue;if(null!==o){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}a9(t,o,n)}break;case 5:var i=t.stateNode;if(null===n&&4&t.flags){n=i;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var s=t.alternate;if(null!==s){var c=s.memoizedState;if(null!==c){var d=c.dehydrated;null!==d&&tK(d)}}}break;default:throw Error(f(163))}oU||512&t.flags&&oY(t)}catch(e){i1(t,t.return,e)}}if(t===e){oW=null;break}if(null!==(n=t.sibling)){n.return=t.return,oW=n;break}oW=t.return}}function o9(e){for(;null!==oW;){var t=oW;if(t===e){oW=null;break}var n=t.sibling;if(null!==n){n.return=t.return,oW=n;break}oW=t.return}}function ie(e){for(;null!==oW;){var t=oW;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{oJ(4,t)}catch(e){i1(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var a=t.return;try{r.componentDidMount()}catch(e){i1(t,a,e)}}var l=t.return;try{oY(t)}catch(e){i1(t,l,e)}break;case 5:var o=t.return;try{oY(t)}catch(e){i1(t,o,e)}}}catch(e){i1(t,t.return,e)}if(t===e){oW=null;break}var i=t.sibling;if(null!==i){i.return=t.return,oW=i;break}oW=t.return}}var it=Math.ceil,ir=P.ReactCurrentDispatcher,ia=P.ReactCurrentOwner,il=P.ReactCurrentBatchConfig,io=0,ii=null,iu=null,is=0,ic=0,id=r0(0),ip=0,ih=null,im=0,iy=0,ig=0,iv=null,ib=null,iw=0,ik=1/0,ix=null,i$=!1,iS=null,iE=null,iC=!1,iP=null,iT=0,iF=0,iN=null,iA=-1,i_=0;function iD(){return 0!=(6&io)?tn():-1!==iA?iA:iA=tn()}function iL(e){return 0==(1&e.mode)?1:0!=(2&io)&&0!==is?is&-is:null!==aO.transition?(0===i_&&(i_=tb()),i_):0!==(e=t$)?e:e=void 0===(e=window.event)?16:t0(e.type)}function iO(e,t,n,r){if(50<iF)throw iF=0,iN=null,Error(f(185));tk(e,n,r),(0==(2&io)||e!==ii)&&(e===ii&&(0==(2&io)&&(iy|=n),4===ip&&iR(e,is)),iI(e,r),1===n&&0===io&&0==(1&t.mode)&&(ik=tn()+500,al&&au()))}function iI(e,t){var n,r=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,l=e.pendingLanes;0<l;){var o=31-td(l),i=1<<o,u=a[o];-1===u?(0==(i&n)||0!=(i&r))&&(a[o]=function(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return -1}}(i,t)):u<=t&&(e.expiredLanes|=i),l&=~i}}(e,t);var a=tg(e,e===ii?is:0);if(0===a)null!==r&&e9(r),e.callbackNode=null,e.callbackPriority=0;else if(t=a&-a,e.callbackPriority!==t){if(null!=r&&e9(r),1===t)0===e.tag?(n=ij.bind(null,e),al=!0,ai(n)):ai(ij.bind(null,e)),rI(function(){0==(6&io)&&au()}),r=null;else{switch(tS(a)){case 1:r=ta;break;case 4:r=tl;break;case 16:default:r=to;break;case 536870912:r=tu}r=e7(r,iB.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function iB(e,t){if(iA=-1,i_=0,0!=(6&io))throw Error(f(327));var n=e.callbackNode;if(iZ()&&e.callbackNode!==n)return null;var r=tg(e,e===ii?is:0);if(0===r)return null;if(0!=(30&r)||0!=(r&e.expiredLanes)||t)t=iq(e,r);else{t=r;var a=io;io|=2;var l=iQ();for((ii!==e||is!==t)&&(ix=null,ik=tn()+500,iW(e,t));;)try{(function(){for(;null!==iu&&!te();)iJ(iu)})();break}catch(t){iK(e,t)}aK(),ir.current=l,io=a,null!==iu?t=0:(ii=null,is=0,t=ip)}if(0!==t){if(2===t&&0!==(a=tv(e))&&(r=a,t=iz(e,a)),1===t)throw n=ih,iW(e,0),iR(e,r),iI(e,tn()),n;if(6===t)iR(e,r);else{if(a=e.current.alternate,0==(30&r)&&!function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var a=n[r],l=a.getSnapshot;a=a.value;try{if(!nq(l(),a))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(a)&&(2===(t=iq(e,r))&&0!==(l=tv(e))&&(r=l,t=iz(e,l)),1===t))throw n=ih,iW(e,0),iR(e,r),iI(e,tn()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(f(345));case 2:case 5:iG(e,ib,ix);break;case 3:if(iR(e,r),(130023424&r)===r&&10<(t=iw+500-tn())){if(0!==tg(e,0))break;if(((a=e.suspendedLanes)&r)!==r){iD(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=rD(iG.bind(null,e,ib,ix),t);break}iG(e,ib,ix);break;case 4:if(iR(e,r),(4194240&r)===r)break;for(a=-1,t=e.eventTimes;0<r;){var o=31-td(r);l=1<<o,(o=t[o])>a&&(a=o),r&=~l}if(r=a,10<(r=(120>(r=tn()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*it(r/1960))-r)){e.timeoutHandle=rD(iG.bind(null,e,ib,ix),r);break}iG(e,ib,ix);break;default:throw Error(f(329))}}}return iI(e,tn()),e.callbackNode===n?iB.bind(null,e):null}function iz(e,t){var n=iv;return e.current.memoizedState.isDehydrated&&(iW(e,t).flags|=256),2!==(e=iq(e,t))&&(t=ib,ib=n,null!==t&&iM(t)),e}function iM(e){null===ib?ib=e:ib.push.apply(ib,e)}function iR(e,t){for(t&=~ig,t&=~iy,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-td(t),r=1<<n;e[n]=-1,t&=~r}}function ij(e){if(0!=(6&io))throw Error(f(327));iZ();var t=tg(e,0);if(0==(1&t))return iI(e,tn()),null;var n=iq(e,t);if(0!==e.tag&&2===n){var r=tv(e);0!==r&&(t=r,n=iz(e,r))}if(1===n)throw n=ih,iW(e,0),iR(e,t),iI(e,tn()),n;if(6===n)throw Error(f(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,iG(e,ib,ix),iI(e,tn()),null}function iV(e,t){var n=io;io|=1;try{return e(t)}finally{0===(io=n)&&(ik=tn()+500,al&&au())}}function iU(e){null!==iP&&0===iP.tag&&0==(6&io)&&iZ();var t=io;io|=1;var n=il.transition,r=t$;try{if(il.transition=null,t$=1,e)return e()}finally{t$=r,il.transition=n,0==(6&(io=t))&&au()}}function iH(){ic=id.current,r1(id)}function iW(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,rL(n)),null!==iu)for(n=iu.return;null!==n;){var r=n;switch(ak(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&r9();break;case 3:lo(),r1(r5),r1(r4),lf();break;case 5:lu(r);break;case 4:lo();break;case 13:case 19:r1(ls);break;case 10:aQ(r.type._context);break;case 22:case 23:iH()}n=n.return}if(ii=e,iu=e=i9(e.current,null),is=ic=t,ip=0,ih=null,ig=iy=im=0,ib=iv=null,null!==aY){for(t=0;t<aY.length;t++)if(null!==(r=(n=aY[t]).interleaved)){n.interleaved=null;var a=r.next,l=n.pending;if(null!==l){var o=l.next;l.next=a,r.next=o}n.pending=r}aY=null}return e}function iK(e,t){for(;;){var n=iu;try{if(aK(),lp.current=l6,lb){for(var r=ly.memoizedState;null!==r;){var a=r.queue;null!==a&&(a.pending=null),r=r.next}lb=!1}if(lm=0,lv=lg=ly=null,lw=!1,lk=0,ia.current=null,null===n||null===n.return){ip=1,ih=t,iu=null;break}e:{var l=e,o=n.return,i=n,u=t;if(t=is,i.flags|=32768,null!==u&&"object"==typeof u&&"function"==typeof u.then){var s=u,c=i,d=c.tag;if(0==(1&c.mode)&&(0===d||11===d||15===d)){var p=c.alternate;p?(c.updateQueue=p.updateQueue,c.memoizedState=p.memoizedState,c.lanes=p.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=om(o);if(null!==h){h.flags&=-257,oy(h,o,i,l,t),1&h.mode&&oh(l,s,t),t=h,u=s;var m=t.updateQueue;if(null===m){var y=new Set;y.add(u),t.updateQueue=y}else m.add(u);break e}if(0==(1&t)){oh(l,s,t),iX();break e}u=Error(f(426))}else if(aS&&1&i.mode){var g=om(o);if(null!==g){0==(65536&g.flags)&&(g.flags|=256),oy(g,o,i,l,t),aL(ou(u,i));break e}}l=u=ou(u,i),4!==ip&&(ip=2),null===iv?iv=[l]:iv.push(l),l=o;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var v=of(l,u,t);a6(l,v);break e;case 1:i=u;var b=l.type,w=l.stateNode;if(0==(128&l.flags)&&("function"==typeof b.getDerivedStateFromError||null!==w&&"function"==typeof w.componentDidCatch&&(null===iE||!iE.has(w)))){l.flags|=65536,t&=-t,l.lanes|=t;var k=op(l,i,t);a6(l,k);break e}}l=l.return}while(null!==l)}iY(n)}catch(e){t=e,iu===n&&null!==n&&(iu=n=n.return);continue}break}}function iQ(){var e=ir.current;return ir.current=l6,null===e?l6:e}function iX(){(0===ip||3===ip||2===ip)&&(ip=4),null===ii||0==(268435455&im)&&0==(268435455&iy)||iR(ii,is)}function iq(e,t){var n=io;io|=2;var r=iQ();for((ii!==e||is!==t)&&(ix=null,iW(e,t));;)try{(function(){for(;null!==iu;)iJ(iu)})();break}catch(t){iK(e,t)}if(aK(),io=n,ir.current=r,null!==iu)throw Error(f(261));return ii=null,is=0,ip}function iJ(e){var t=s(e.alternate,e,ic);e.memoizedProps=e.pendingProps,null===t?iY(e):iu=t,ia.current=null}function iY(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(32768&t.flags)){if(null!==(n=function(e,t,n){var r=t.pendingProps;switch(ak(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return oj(t),null;case 1:case 17:return r7(t.type)&&r9(),oj(t),null;case 3:return r=t.stateNode,lo(),r1(r5),r1(r4),lf(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(null===e||null===e.child)&&(aA(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==aE&&(iM(aE),aE=null))),o(e,t),oj(t),null;case 5:lu(t);var l=la(lr.current);if(n=t.type,null!==e&&null!=t.stateNode)i(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(f(166));return oj(t),null}if(e=la(lt.current),aA(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[rV]=t,r[rU]=s,e=0!=(1&t.mode),n){case"dialog":rm("cancel",r),rm("close",r);break;case"iframe":case"object":case"embed":rm("load",r);break;case"video":case"audio":for(l=0;l<rd.length;l++)rm(rd[l],r);break;case"source":rm("error",r);break;case"img":case"image":case"link":rm("error",r),rm("load",r);break;case"details":rm("toggle",r);break;case"input":ef(r,s),rm("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},rm("invalid",r);break;case"textarea":ew(r,s),rm("invalid",r)}for(var c in eL(n,s),l=null,s)if(s.hasOwnProperty(c)){var d=s[c];"children"===c?"string"==typeof d?r.textContent!==d&&(!0!==s.suppressHydrationWarning&&rT(r.textContent,d,e),l=["children",d]):"number"==typeof d&&r.textContent!==""+d&&(!0!==s.suppressHydrationWarning&&rT(r.textContent,d,e),l=["children",""+d]):h.hasOwnProperty(c)&&null!=d&&"onScroll"===c&&rm("scroll",r)}switch(n){case"input":eu(r),em(r,s,!0);break;case"textarea":eu(r),ex(r);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(r.onclick=rF)}r=l,t.updateQueue=r,null!==r&&(t.flags|=4)}else{c=9===l.nodeType?l:l.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=e$(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=c.createElement("div")).innerHTML="<script></\script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),"select"===n&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[rV]=t,e[rU]=r,a(e,t,!1,!1),t.stateNode=e;e:{switch(c=eO(n,r),n){case"dialog":rm("cancel",e),rm("close",e),l=r;break;case"iframe":case"object":case"embed":rm("load",e),l=r;break;case"video":case"audio":for(l=0;l<rd.length;l++)rm(rd[l],e);l=r;break;case"source":rm("error",e),l=r;break;case"img":case"image":case"link":rm("error",e),rm("load",e),l=r;break;case"details":rm("toggle",e),l=r;break;case"input":ef(e,r),l=ed(e,r),rm("invalid",e);break;case"option":default:l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=en({},r,{value:void 0}),rm("invalid",e);break;case"textarea":ew(e,r),l=eb(e,r),rm("invalid",e)}for(s in eL(n,l),d=l)if(d.hasOwnProperty(s)){var p=d[s];"style"===s?e_(e,p):"dangerouslySetInnerHTML"===s?null!=(p=p?p.__html:void 0)&&eP(e,p):"children"===s?"string"==typeof p?("textarea"!==n||""!==p)&&eT(e,p):"number"==typeof p&&eT(e,""+p):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(h.hasOwnProperty(s)?null!=p&&"onScroll"===s&&rm("scroll",e):null!=p&&C(e,s,p,c))}switch(n){case"input":eu(e),em(e,r,!1);break;case"textarea":eu(e),ex(e);break;case"option":null!=r.value&&e.setAttribute("value",""+eo(r.value));break;case"select":e.multiple=!!r.multiple,null!=(s=r.value)?ev(e,!!r.multiple,s,!1):null!=r.defaultValue&&ev(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof l.onClick&&(e.onclick=rF)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return oj(t),null;case 6:if(e&&null!=t.stateNode)u(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(f(166));if(n=la(lr.current),la(lt.current),aA(t)){if(r=t.stateNode,n=t.memoizedProps,r[rV]=t,(s=r.nodeValue!==n)&&null!==(e=ax))switch(e.tag){case 3:rT(r.nodeValue,n,0!=(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&rT(r.nodeValue,n,0!=(1&e.mode))}s&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[rV]=t,t.stateNode=r}return oj(t),null;case 13:if(r1(ls),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(aS&&null!==a$&&0!=(1&t.mode)&&0==(128&t.flags))a_(),aD(),t.flags|=98560,s=!1;else if(s=aA(t),null!==r&&null!==r.dehydrated){if(null===e){if(!s)throw Error(f(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(f(317));s[rV]=t}else aD(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;oj(t),s=!1}else null!==aE&&(iM(aE),aE=null),s=!0;if(!s)return 65536&t.flags?t:null}if(0!=(128&t.flags))return t.lanes=n,t;return(r=null!==r)!=(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&ls.current)?0===ip&&(ip=3):iX())),null!==t.updateQueue&&(t.flags|=4),oj(t),null;case 4:return lo(),o(e,t),null===e&&rv(t.stateNode.containerInfo),oj(t),null;case 10:return aQ(t.type._context),oj(t),null;case 19:if(r1(ls),null===(s=t.memoizedState))return oj(t),null;if(r=0!=(128&t.flags),null===(c=s.rendering)){if(r)oR(s,!1);else{if(0!==ip||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(c=lc(e))){for(t.flags|=128,oR(s,!1),null!==(r=c.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)s=n,e=r,s.flags&=14680066,null===(c=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return r2(ls,1&ls.current|2),t.child}e=e.sibling}null!==s.tail&&tn()>ik&&(t.flags|=128,r=!0,oR(s,!1),t.lanes=4194304)}}else{if(!r){if(null!==(e=lc(c))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),oR(s,!0),null===s.tail&&"hidden"===s.tailMode&&!c.alternate&&!aS)return oj(t),null}else 2*tn()-s.renderingStartTime>ik&&1073741824!==n&&(t.flags|=128,r=!0,oR(s,!1),t.lanes=4194304)}s.isBackwards?(c.sibling=t.child,t.child=c):(null!==(n=s.last)?n.sibling=c:t.child=c,s.last=c)}if(null!==s.tail)return t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=tn(),t.sibling=null,n=ls.current,r2(ls,r?1&n|2:1&n),t;return oj(t),null;case 22:case 23:return iH(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(1073741824&ic)&&(oj(t),6&t.subtreeFlags&&(t.flags|=8192)):oj(t),null;case 24:case 25:return null}throw Error(f(156,t.tag))}(n,t,ic))){iu=n;return}}else{if(null!==(n=function(e,t){switch(ak(t),t.tag){case 1:return r7(t.type)&&r9(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return lo(),r1(r5),r1(r4),lf(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return lu(t),null;case 13:if(r1(ls),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(f(340));aD()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return r1(ls),null;case 4:return lo(),null;case 10:return aQ(t.type._context),null;case 22:case 23:return iH(),null;default:return null}}(n,t))){n.flags&=32767,iu=n;return}if(null!==e)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ip=6,iu=null;return}}if(null!==(t=t.sibling)){iu=t;return}iu=t=e}while(null!==t)0===ip&&(ip=5)}function iG(e,t,n){var r=t$,a=il.transition;try{il.transition=null,t$=1,function(e,t,n,r){do iZ();while(null!==iP)if(0!=(6&io))throw Error(f(327));n=e.finishedWork;var a=e.finishedLanes;if(null!==n){if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(f(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-td(n),l=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~l}}(e,l),e===ii&&(iu=ii=null,is=0),0==(2064&n.subtreeFlags)&&0==(2064&n.flags)||iC||(iC=!0,o=to,i=function(){return iZ(),null},e7(o,i)),l=0!=(15990&n.flags),0!=(15990&n.subtreeFlags)||l){l=il.transition,il.transition=null;var o,i,u,s,c,d=t$;t$=1;var p=io;io|=4,ia.current=null,function(e,t){if(rN=tX,n0(e=nZ())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var a,l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch(e){n=null;break e}var i=0,u=-1,s=-1,c=0,d=0,p=e,h=null;t:for(;;){for(;p!==n||0!==l&&3!==p.nodeType||(u=i+l),p!==o||0!==r&&3!==p.nodeType||(s=i+r),3===p.nodeType&&(i+=p.nodeValue.length),null!==(a=p.firstChild);)h=p,p=a;for(;;){if(p===e)break t;if(h===n&&++c===l&&(u=i),h===o&&++d===r&&(s=i),null!==(a=p.nextSibling))break;h=(p=h).parentNode}p=a}n=-1===u||-1===s?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(rA={focusedElem:e,selectionRange:n},tX=!1,oW=t;null!==oW;)if(e=(t=oW).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,oW=e;else for(;null!==oW;){t=oW;try{var m=t.alternate;if(0!=(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var y=m.memoizedProps,g=m.memoizedState,v=t.stateNode,b=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:ot(t.type,y),g);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;1===w.nodeType?w.textContent="":9===w.nodeType&&w.documentElement&&w.removeChild(w.documentElement);break;default:throw Error(f(163))}}catch(e){i1(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,oW=e;break}oW=t.return}m=oX,oX=!1}(e,n),o8(n,e),function(e){var t=nZ(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&function e(t,n){return!!t&&!!n&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(n.ownerDocument.documentElement,n)){if(null!==r&&n0(n)){if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var a=n.textContent.length,l=Math.min(r.start,a);r=void 0===r.end?l:Math.min(r.end,a),!e.extend&&l>r&&(a=r,r=l,l=a),a=nG(n,l);var o=nG(n,r);a&&o&&(1!==e.rangeCount||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(a.node,a.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}(rA),tX=!!rN,rA=rN=null,e.current=n,u=n,s=e,c=a,oW=u,function e(t,n,r){for(var a=0!=(1&t.mode);null!==oW;){var l=oW,o=l.child;if(22===l.tag&&a){var i=null!==l.memoizedState||oV;if(!i){var u=l.alternate,s=null!==u&&null!==u.memoizedState||oU;u=oV;var c=oU;if(oV=i,(oU=s)&&!c)for(oW=l;null!==oW;)s=(i=oW).child,22===i.tag&&null!==i.memoizedState?ie(l):null!==s?(s.return=i,oW=s):ie(l);for(;null!==o;)oW=o,e(o,n,r),o=o.sibling;oW=l,oV=u,oU=c}o7(t,n,r)}else 0!=(8772&l.subtreeFlags)&&null!==o?(o.return=l,oW=o):o7(t,n,r)}}(u,s,c),tt(),io=p,t$=d,il.transition=l}else e.current=n;if(iC&&(iC=!1,iP=e,iT=a),0===(l=e.pendingLanes)&&(iE=null),function(e){if(tc&&"function"==typeof tc.onCommitFiberRoot)try{tc.onCommitFiberRoot(ts,e,void 0,128==(128&e.current.flags))}catch(e){}}(n.stateNode,r),iI(e,tn()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)r((a=t[n]).value,{componentStack:a.stack,digest:a.digest});if(i$)throw i$=!1,e=iS,iS=null,e;0!=(1&iT)&&0!==e.tag&&iZ(),0!=(1&(l=e.pendingLanes))?e===iN?iF++:(iF=0,iN=e):iF=0,au()}}(e,t,n,r)}finally{il.transition=a,t$=r}return null}function iZ(){if(null!==iP){var e=tS(iT),t=il.transition,n=t$;try{if(il.transition=null,t$=16>e?16:e,null===iP)var r=!1;else{if(e=iP,iP=null,iT=0,0!=(6&io))throw Error(f(331));var a=io;for(io|=4,oW=e.current;null!==oW;){var l=oW,o=l.child;if(0!=(16&oW.flags)){var i=l.deletions;if(null!==i){for(var u=0;u<i.length;u++){var s=i[u];for(oW=s;null!==oW;){var c=oW;switch(c.tag){case 0:case 11:case 15:oq(8,c,l)}var d=c.child;if(null!==d)d.return=c,oW=d;else for(;null!==oW;){var p=(c=oW).sibling,h=c.return;if(function e(t){var n=t.alternate;null!==n&&(t.alternate=null,e(n)),t.child=null,t.deletions=null,t.sibling=null,5===t.tag&&null!==(n=t.stateNode)&&(delete n[rV],delete n[rU],delete n[rW],delete n[rK],delete n[rQ]),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}(c),c===s){oW=null;break}if(null!==p){p.return=h,oW=p;break}oW=h}}}var m=l.alternate;if(null!==m){var y=m.child;if(null!==y){m.child=null;do{var g=y.sibling;y.sibling=null,y=g}while(null!==y)}}oW=l}}if(0!=(2064&l.subtreeFlags)&&null!==o)o.return=l,oW=o;else for(;null!==oW;){if(l=oW,0!=(2048&l.flags))switch(l.tag){case 0:case 11:case 15:oq(9,l,l.return)}var v=l.sibling;if(null!==v){v.return=l.return,oW=v;break}oW=l.return}}var b=e.current;for(oW=b;null!==oW;){var w=(o=oW).child;if(0!=(2064&o.subtreeFlags)&&null!==w)w.return=o,oW=w;else for(o=b;null!==oW;){if(i=oW,0!=(2048&i.flags))try{switch(i.tag){case 0:case 11:case 15:oJ(9,i)}}catch(e){i1(i,i.return,e)}if(i===o){oW=null;break}var k=i.sibling;if(null!==k){k.return=i.return,oW=k;break}oW=i.return}}if(io=a,au(),tc&&"function"==typeof tc.onPostCommitFiberRoot)try{tc.onPostCommitFiberRoot(ts,e)}catch(e){}r=!0}return r}finally{t$=n,il.transition=t}}return!1}function i0(e,t,n){t=of(e,t=ou(n,t),1),e=a5(e,t,1),t=iD(),null!==e&&(tk(e,1,t),iI(e,t))}function i1(e,t,n){if(3===e.tag)i0(e,e,n);else for(;null!==t;){if(3===t.tag){i0(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===iE||!iE.has(r))){e=op(t,e=ou(n,e),1),t=a5(t,e,1),e=iD(),null!==t&&(tk(t,1,e),iI(t,e));break}}t=t.return}}function i2(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=iD(),e.pingedLanes|=e.suspendedLanes&n,ii===e&&(is&n)===n&&(4===ip||3===ip&&(130023424&is)===is&&500>tn()-iw?iW(e,0):ig|=n),iI(e,t)}function i3(e,t){0===t&&(0==(1&e.mode)?t=1:(t=tm,0==(130023424&(tm<<=1))&&(tm=4194304)));var n=iD();null!==(e=a0(e,t))&&(tk(e,t,n),iI(e,n))}function i4(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),i3(e,n)}function i5(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;null!==a&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(f(314))}null!==r&&r.delete(t),i3(e,n)}function i8(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function i6(e,t,n,r){return new i8(e,t,n,r)}function i7(e){return!(!(e=e.prototype)||!e.isReactComponent)}function i9(e,t){var n=e.alternate;return null===n?((n=i6(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ue(e,t,n,r,a,l){var o=2;if(r=e,"function"==typeof e)i7(e)&&(o=1);else if("string"==typeof e)o=5;else e:switch(e){case N:return ut(n.children,a,l,t);case A:o=8,a|=8;break;case _:return(e=i6(12,n,t,2|a)).elementType=_,e.lanes=l,e;case I:return(e=i6(13,n,t,a)).elementType=I,e.lanes=l,e;case B:return(e=i6(19,n,t,a)).elementType=B,e.lanes=l,e;case R:return un(n,a,l,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case D:o=10;break e;case L:o=9;break e;case O:o=11;break e;case z:o=14;break e;case M:o=16,r=null;break e}throw Error(f(130,null==e?e:typeof e,""))}return(t=i6(o,n,t,a)).elementType=e,t.type=r,t.lanes=l,t}function ut(e,t,n,r){return(e=i6(7,e,r,t)).lanes=n,e}function un(e,t,n,r){return(e=i6(22,e,r,t)).elementType=R,e.lanes=n,e.stateNode={isHidden:!1},e}function ur(e,t,n){return(e=i6(6,e,null,t)).lanes=n,e}function ua(e,t,n){return(t=i6(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ul(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=tw(0),this.expirationTimes=tw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tw(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function uo(e,t,n,r,a,l,o,i,u){return e=new ul(e,t,n,i,u),1===t?(t=1,!0===l&&(t|=8)):t=0,l=i6(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},a2(l),e}function ui(e){if(!e)return r3;e=e._reactInternals;e:{if(e4(e)!==e||1!==e.tag)throw Error(f(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(r7(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t)throw Error(f(171))}if(1===e.tag){var n=e.type;if(r7(n))return at(e,n,t)}return t}function uu(e,t,n,r,a,l,o,i,u){return(e=uo(n,r,!0,e,a,l,o,i,u)).context=ui(null),n=e.current,(l=a4(r=iD(),a=iL(n))).callback=null!=t?t:null,a5(n,l,a),e.current.lanes=a,tk(e,a,r),iI(e,r),e}function us(e,t,n,r){var a=t.current,l=iD(),o=iL(a);return n=ui(n),null===t.context?t.context=n:t.pendingContext=n,(t=a4(l,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=a5(a,t,o))&&(iO(e,a,o,l),a8(e,a,o)),o}function uc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function ud(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function uf(e,t){ud(e,t),(e=e.alternate)&&ud(e,t)}s=function(e,t,n){if(null!==e){if(e.memoizedProps!==t.pendingProps||r5.current)ov=!0;else{if(0==(e.lanes&n)&&0==(128&t.flags))return ov=!1,function(e,t,n){switch(t.tag){case 3:oT(t),aD();break;case 5:li(t);break;case 1:r7(t.type)&&an(t);break;case 4:ll(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;r2(aV,r._currentValue),r._currentValue=a;break;case 13:if(null!==(r=t.memoizedState)){if(null!==r.dehydrated)return r2(ls,1&ls.current),t.flags|=128,null;if(0!=(n&t.child.childLanes))return o_(e,t,n);return r2(ls,1&ls.current),null!==(e=oM(e,t,n))?e.sibling:null}r2(ls,1&ls.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(128&e.flags)){if(r)return oB(e,t,n);t.flags|=128}if(null!==(a=t.memoizedState)&&(a.rendering=null,a.tail=null,a.lastEffect=null),r2(ls,ls.current),!r)return null;break;case 22:case 23:return t.lanes=0,o$(e,t,n)}return oM(e,t,n)}(e,t,n);ov=0!=(131072&e.flags)}}else ov=!1,aS&&0!=(1048576&t.flags)&&ab(t,af,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;oz(e,t),e=t.pendingProps;var a=r6(t,r4.current);aq(t,n),a=lE(null,t,r,e,a,n);var l=lC();return t.flags|=1,"object"==typeof a&&null!==a&&"function"==typeof a.render&&void 0===a.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,r7(r)?(l=!0,an(t)):l=!1,t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,a2(t),a.updater=or,t.stateNode=a,a._reactInternals=t,oi(t,r,e,n),t=oP(null,t,r,!0,l,n)):(t.tag=0,aS&&l&&aw(t),ob(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(oz(e,t),e=t.pendingProps,r=(a=r._init)(r._payload),t.type=r,a=t.tag=function(e){if("function"==typeof e)return i7(e)?1:0;if(null!=e){if((e=e.$$typeof)===O)return 11;if(e===z)return 14}return 2}(r),e=ot(r,e),a){case 0:t=oE(null,t,r,e,n);break e;case 1:t=oC(null,t,r,e,n);break e;case 11:t=ow(null,t,r,e,n);break e;case 14:t=ok(null,t,r,ot(r.type,e),n);break e}throw Error(f(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:ot(r,a),oE(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:ot(r,a),oC(e,t,r,a,n);case 3:e:{if(oT(t),null===e)throw Error(f(387));r=t.pendingProps,a=(l=t.memoizedState).element,a3(e,t),a7(t,r,null,n);var o=t.memoizedState;if(r=o.element,l.isDehydrated){if(l={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=l,t.memoizedState=l,256&t.flags){a=ou(Error(f(423)),t),t=oF(e,t,r,n,a);break e}if(r!==a){a=ou(Error(f(424)),t),t=oF(e,t,r,n,a);break e}for(a$=rM(t.stateNode.containerInfo.firstChild),ax=t,aS=!0,aE=null,n=aj(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(aD(),r===a){t=oM(e,t,n);break e}ob(e,t,r,n)}t=t.child}return t;case 5:return li(t),null===e&&aF(t),r=t.type,a=t.pendingProps,l=null!==e?e.memoizedProps:null,o=a.children,r_(r,a)?o=null:null!==l&&r_(r,l)&&(t.flags|=32),oS(e,t),ob(e,t,o,n),t.child;case 6:return null===e&&aF(t),null;case 13:return o_(e,t,n);case 4:return ll(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=aR(t,null,r,n):ob(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:ot(r,a),ow(e,t,r,a,n);case 7:return ob(e,t,t.pendingProps,n),t.child;case 8:case 12:return ob(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,l=t.memoizedProps,o=a.value,r2(aV,r._currentValue),r._currentValue=o,null!==l){if(nq(l.value,o)){if(l.children===a.children&&!r5.current){t=oM(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var i=l.dependencies;if(null!==i){o=l.child;for(var u=i.firstContext;null!==u;){if(u.context===r){if(1===l.tag){(u=a4(-1,n&-n)).tag=2;var s=l.updateQueue;if(null!==s){var c=(s=s.shared).pending;null===c?u.next=u:(u.next=c.next,c.next=u),s.pending=u}}l.lanes|=n,null!==(u=l.alternate)&&(u.lanes|=n),aX(l.return,n,t),i.lanes|=n;break}u=u.next}}else if(10===l.tag)o=l.type===t.type?null:l.child;else if(18===l.tag){if(null===(o=l.return))throw Error(f(341));o.lanes|=n,null!==(i=o.alternate)&&(i.lanes|=n),aX(o,n,t),o=l.sibling}else o=l.child;if(null!==o)o.return=l;else for(o=l;null!==o;){if(o===t){o=null;break}if(null!==(l=o.sibling)){l.return=o.return,o=l;break}o=o.return}l=o}}ob(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,aq(t,n),r=r(a=aJ(a)),t.flags|=1,ob(e,t,r,n),t.child;case 14:return a=ot(r=t.type,t.pendingProps),a=ot(r.type,a),ok(e,t,r,a,n);case 15:return ox(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:ot(r,a),oz(e,t),t.tag=1,r7(r)?(e=!0,an(t)):e=!1,aq(t,n),ol(t,r,a),oi(t,r,a,n),oP(null,t,r,!0,e,n);case 19:return oB(e,t,n);case 22:return o$(e,t,n)}throw Error(f(156,t.tag))};var up="function"==typeof reportError?reportError:function(e){console.error(e)};function uh(e){this._internalRoot=e}function um(e){this._internalRoot=e}function uy(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function ug(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function uv(){}function ub(e,t,n,r,a){var l=n._reactRootContainer;if(l){var o=l;if("function"==typeof a){var i=a;a=function(){var e=uc(o);i.call(e)}}us(t,o,e,a)}else o=function(e,t,n,r,a){if(a){if("function"==typeof r){var l=r;r=function(){var e=uc(o);l.call(e)}}var o=uu(t,r,e,0,null,!1,!1,"",uv);return e._reactRootContainer=o,e[rH]=o.current,rv(8===e.nodeType?e.parentNode:e),iU(),o}for(;a=e.lastChild;)e.removeChild(a);if("function"==typeof r){var i=r;r=function(){var e=uc(u);i.call(e)}}var u=uo(e,0,!1,null,null,!1,!1,"",uv);return e._reactRootContainer=u,e[rH]=u.current,rv(8===e.nodeType?e.parentNode:e),iU(function(){us(t,u,n,r)}),u}(n,t,e,a,r);return uc(o)}um.prototype.render=uh.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(f(409));us(e,t,null,null)},um.prototype.unmount=uh.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;iU(function(){us(null,e,null,null)}),t[rH]=null}},um.prototype.unstable_scheduleHydration=function(e){if(e){var t=tT();e={blockedOn:null,target:e,priority:t};for(var n=0;n<tB.length&&0!==t&&t<tB[n].priority;n++);tB.splice(n,0,e),0===n&&tj(e)}},tE=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ty(t.pendingLanes);0!==n&&(tx(t,1|n),iI(t,tn()),0==(6&io)&&(ik=tn()+500,au()))}break;case 13:iU(function(){var t=a0(e,1);null!==t&&iO(t,e,1,iD())}),uf(e,1)}},tC=function(e){if(13===e.tag){var t=a0(e,134217728);null!==t&&iO(t,e,134217728,iD()),uf(e,134217728)}},tP=function(e){if(13===e.tag){var t=iL(e),n=a0(e,t);null!==n&&iO(n,e,t,iD()),uf(e,t)}},tT=function(){return t$},tF=function(e,t){var n=t$;try{return t$=e,t()}finally{t$=n}},ez=function(e,t,n){switch(t){case"input":if(eh(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=rY(r);if(!a)throw Error(f(90));es(r),eh(r,a)}}}break;case"textarea":ek(e,n);break;case"select":null!=(t=n.value)&&ev(e,!!n.multiple,t,!1)}},eH=iV,eW=iU;var uw={findFiberByHostInstance:rX,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},uk={bundleType:uw.bundleType,version:uw.version,rendererPackageName:uw.rendererPackageName,rendererConfig:uw.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=e6(e))?null:e.stateNode},findFiberByHostInstance:uw.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var ux=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ux.isDisabled&&ux.supportsFiber)try{ts=ux.inject(uk),tc=ux}catch(e){}}U={usingClientEntryPoint:!1,Events:[rq,rJ,rY,eV,eU,iV]},H=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!uy(t))throw Error(f(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:F,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},W=function(e,t){if(!uy(e))throw Error(f(299));var n=!1,r="",a=up;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(a=t.onRecoverableError)),t=uo(e,1,!1,null,null,n,!1,r,a),e[rH]=t.current,rv(8===e.nodeType?e.parentNode:e),new uh(t)},K=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(f(188));throw Error(f(268,e=Object.keys(e).join(",")))}return e=null===(e=e6(t))?null:e.stateNode},Q=function(e){return iU(e)},X=function(e,t,n){if(!ug(t))throw Error(f(200));return ub(null,e,t,!0,n)},q=function(e,t,n){if(!uy(e))throw Error(f(405));var r=null!=n&&n.hydratedSources||null,a=!1,l="",o=up;if(null!=n&&(!0===n.unstable_strictMode&&(a=!0),void 0!==n.identifierPrefix&&(l=n.identifierPrefix),void 0!==n.onRecoverableError&&(o=n.onRecoverableError)),t=uu(t,null,e,1,null!=n?n:null,a,!1,l,o),e[rH]=t.current,rv(e),r)for(e=0;e<r.length;e++)a=(a=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new um(t)},J=function(e,t,n){if(!ug(t))throw Error(f(200));return ub(null,e,t,!1,n)},Y=function(e){if(!ug(e))throw Error(f(40));return!!e._reactRootContainer&&(iU(function(){ub(null,null,e,!1,function(){e._reactRootContainer=null,e[rH]=null})}),!0)},G=iV,Z=function(e,t,n,r){if(!ug(n))throw Error(f(200));if(null==e||void 0===e._reactInternals)throw Error(f(38));return ub(e,t,n,!1,r)},ee="18.3.1-next-f1338f8080-20240426"}),o("acw62",function(e,t){e.exports=l("2pUnB")}),o("fO90s",function(e,t){e.exports=l("gcnCG")}),o("gcnCG",function(t,n){function r(e,t){var n=e.length;for(e.push(t);0<n;){var r=n-1>>>1,a=e[r];if(0<o(a,t))e[r]=t,e[n]=a,n=r;else break}}function a(e){return 0===e.length?null:e[0]}function l(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;for(var r=0,a=e.length,l=a>>>1;r<l;){var i=2*(r+1)-1,u=e[i],s=i+1,c=e[s];if(0>o(u,n))s<a&&0>o(c,u)?(e[r]=c,e[s]=n,r=s):(e[r]=u,e[i]=n,r=i);else if(s<a&&0>o(c,n))e[r]=c,e[s]=n,r=s;else break}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e(t.exports,"unstable_now",()=>i,e=>i=e),e(t.exports,"unstable_IdlePriority",()=>u,e=>u=e),e(t.exports,"unstable_ImmediatePriority",()=>s,e=>s=e),e(t.exports,"unstable_LowPriority",()=>c,e=>c=e),e(t.exports,"unstable_NormalPriority",()=>d,e=>d=e),e(t.exports,"unstable_Profiling",()=>f,e=>f=e),e(t.exports,"unstable_UserBlockingPriority",()=>p,e=>p=e),e(t.exports,"unstable_cancelCallback",()=>h,e=>h=e),e(t.exports,"unstable_continueExecution",()=>m,e=>m=e),e(t.exports,"unstable_forceFrameRate",()=>y,e=>y=e),e(t.exports,"unstable_getCurrentPriorityLevel",()=>g,e=>g=e),e(t.exports,"unstable_getFirstCallbackNode",()=>v,e=>v=e),e(t.exports,"unstable_next",()=>b,e=>b=e),e(t.exports,"unstable_pauseExecution",()=>w,e=>w=e),e(t.exports,"unstable_requestPaint",()=>k,e=>k=e),e(t.exports,"unstable_runWithPriority",()=>x,e=>x=e),e(t.exports,"unstable_scheduleCallback",()=>$,e=>$=e),e(t.exports,"unstable_shouldYield",()=>S,e=>S=e),e(t.exports,"unstable_wrapCallback",()=>E,e=>E=e),"object"==typeof performance&&"function"==typeof performance.now){var i,u,s,c,d,f,p,h,m,y,g,v,b,w,k,x,$,S,E,C,P=performance;i=function(){return P.now()}}else{var T=Date,F=T.now();i=function(){return T.now()-F}}var N=[],A=[],_=1,D=null,L=3,O=!1,I=!1,B=!1,z="function"==typeof setTimeout?setTimeout:null,M="function"==typeof clearTimeout?clearTimeout:null,R="undefined"!=typeof setImmediate?setImmediate:null;function j(e){for(var t=a(A);null!==t;){if(null===t.callback)l(A);else if(t.startTime<=e)l(A),t.sortIndex=t.expirationTime,r(N,t);else break;t=a(A)}}function V(e){if(B=!1,j(e),!I){if(null!==a(N))I=!0,Z(U);else{var t=a(A);null!==t&&ee(V,t.startTime-e)}}}function U(e,t){I=!1,B&&(B=!1,M(K),K=-1),O=!0;var n=L;try{for(j(t),D=a(N);null!==D&&(!(D.expirationTime>t)||e&&!q());){var r=D.callback;if("function"==typeof r){D.callback=null,L=D.priorityLevel;var o=r(D.expirationTime<=t);t=i(),"function"==typeof o?D.callback=o:D===a(N)&&l(N),j(t)}else l(N);D=a(N)}if(null!==D)var u=!0;else{var s=a(A);null!==s&&ee(V,s.startTime-t),u=!1}return u}finally{D=null,L=n,O=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var H=!1,W=null,K=-1,Q=5,X=-1;function q(){return!(i()-X<Q)}function J(){if(null!==W){var e=i();X=e;var t=!0;try{t=W(!0,e)}finally{t?C():(H=!1,W=null)}}else H=!1}if("function"==typeof R)C=function(){R(J)};else if("undefined"!=typeof MessageChannel){var Y=new MessageChannel,G=Y.port2;Y.port1.onmessage=J,C=function(){G.postMessage(null)}}else C=function(){z(J,0)};function Z(e){W=e,H||(H=!0,C())}function ee(e,t){K=z(function(){e(i())},t)}u=5,s=1,c=4,d=3,f=null,p=2,h=function(e){e.callback=null},m=function(){I||O||(I=!0,Z(U))},y=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<e?Math.floor(1e3/e):5},g=function(){return L},v=function(){return a(N)},b=function(e){switch(L){case 1:case 2:case 3:var t=3;break;default:t=L}var n=L;L=t;try{return e()}finally{L=n}},w=function(){},k=function(){},x=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=L;L=e;try{return t()}finally{L=n}},$=function(e,t,n){var l=i();switch(n="object"==typeof n&&null!==n&&"number"==typeof(n=n.delay)&&0<n?l+n:l,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=n+o,e={id:_++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>l?(e.sortIndex=n,r(A,e),null===a(N)&&e===a(A)&&(B?(M(K),K=-1):B=!0,ee(V,n-l))):(e.sortIndex=o,r(N,e),I||O||(I=!0,Z(U))),e},S=q,E=function(e){var t=L;return function(){var n=L;L=t;try{return e.apply(this,arguments)}finally{L=n}}}});var i=l("acw62"),u={};!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),t=(u=l("Xw6Mv")).createRoot,u.hydrateRoot;var i=l("acw62"),s=function(e,t,n,r){var a;t[0]=0;for(var l=1;l<t.length;l++){var o=t[l++],i=t[l]?(t[0]|=o?1:2,n[t[l++]]):t[++l];3===o?r[0]=i:4===o?r[1]=Object.assign(r[1]||{},i):5===o?(r[1]=r[1]||{})[t[++l]]=i:6===o?r[1][t[++l]]+=i+"":o?(a=e.apply(i,s(e,i,n,["",null])),r.push(a),i[0]?t[0]|=2:(t[l-2]=0,t[l]=a)):r.push(i)}return r},c=new Map,d=(function(e){var t=c.get(this);return t||(t=new Map,c.set(this,t)),(t=s(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,a="",l="",o=[0],i=function(e){1===r&&(e||(a=a.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?o.push(0,e,a):3===r&&(e||a)?(o.push(3,e,a),r=2):2===r&&"..."===a&&e?o.push(4,e,0):2===r&&a&&!e?o.push(5,0,!0,a):r>=5&&((a||!e&&5===r)&&(o.push(r,0,a,n),r=6),e&&(o.push(r,e,0,n),r=6)),a=""},u=0;u<e.length;u++){u&&(1===r&&i(),i(u));for(var s=0;s<e[u].length;s++)t=e[u][s],1===r?"<"===t?(i(),o=[o],r=3):a+=t:4===r?"--"===a&&">"===t?(r=1,a=""):a=t+a[0]:l?t===l?l="":a+=t:'"'===t||"'"===t?l=t:">"===t?(i(),r=1):r&&("="===t?(r=5,n=a,a=""):"/"===t&&(r<5||">"===e[u][s+1])?(i(),3===r&&(o=o[0]),r=o,(o=o[0]).push(2,0,r),r=0):" "===t||"	"===t||"\n"===t||"\r"===t?(i(),r=2):a+=t),3===r&&"!--"===a&&(r=4,o=o[0])}return i(),o}(e)),t),arguments,[])).length>1?t:t[0]}).bind(i.createElement);class f{constructor(e){Object.defineProperty(this,"callback",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"dataset",{enumerable:!0,configurable:!0,writable:!0,value:[]})}observe(e,t){let n=new ResizeObserver(()=>{this._checkChange()});for(let t=0;t<e.children.length;t++)n.observe(e.children[t]);let r=new MutationObserver(()=>{this._checkChange(),this.unobserve(e),this.observe.apply(this,arguments)});r.observe(e,{childList:!0});let[a,l]=[e.scrollWidth,e.scrollHeight];this.dataset.push({target:e,entrie:{target:e,scrollWidth:a,scrollHeight:l,previousScrollWidth:a,previousScrollHeight:l},direction:null==t?void 0:t.direction,resize:n,mutation:r})}unobserve(e){let t=[];for(let n of this.dataset)n.target===e?(n.resize.disconnect(),n.mutation.disconnect()):t.push(n);this.dataset=t}disconnect(){for(let e of this.dataset)e.resize.disconnect(),e.mutation.disconnect();this.dataset=[]}_checkChange(){let e=!1,t=[];for(let n of this.dataset){let[r,a]=[n.target.scrollWidth,n.target.scrollHeight],l=n.entrie.scrollWidth!==r,o=n.entrie.scrollHeight!==a;switch(n.direction){case void 0:e=l||o;break;case"x":e=l;break;case"y":e=o}n.entrie.previousScrollHeight=n.entrie.scrollHeight,n.entrie.previousScrollWidth=n.entrie.scrollWidth,n.entrie.scrollWidth=r,n.entrie.scrollHeight=a,t.push(Object.freeze(Object.assign({},n.entrie)))}e&&this.callback(t,this)}}function p(e,t){let n=new Blob([t],{type:"text/plain;charset=utf-8"}),r=URL.createObjectURL(n);var a=document.createElement("a");a.setAttribute("href",r),a.setAttribute("download",e),a.style.display="none",document.body.appendChild(a),a.click(),URL.revokeObjectURL(r),document.body.removeChild(a)}function h(e,t){let n=new URL(e.trim());n.pathname=n.pathname.replace(/\/+/g,"/");let r=n.toString();return 3==t&&(r=r.replace(/\/v1\/?$/,"")),2==t&&(r=r.replace(/\/api\/?$/,"")),r=r.replace(/\/$/,"")}async function m({endpoint:e,endpointAPI:t,endpointAPIKey:n,signal:r,...a}){switch(e=h(e,t),t){case 0:return await k({endpoint:e,endpointAPIKey:n,signal:r,...a});case 2:return await E({endpoint:e,signal:r,...a});case 3:if("api.openai.com"===new URL(e).host||"api.together.xyz"===new URL(e).host)return 0;let l=0;if(-1!=(l=await F({endpoint:e,endpointAPIKey:n,signal:r,...a}))||-1!=(l=await N({endpoint:e,signal:r,...a}))||-1!=(l=await A({endpoint:e,endpointAPIKey:n,signal:r,...a})))return l;return 0}}async function y({endpoint:e,endpointAPI:t,endpointAPIKey:n,signal:r,...a}){switch(e=h(e,t),t){case 0:return await x({endpoint:e,endpointAPIKey:n,signal:r,...a});case 2:return await C({endpoint:e,signal:r,...a});case 3:return await _({endpoint:e,endpointAPIKey:n,signal:r,...a})}}async function g({endpoint:e,endpointAPI:t,endpointAPIKey:n,signal:r,...a}){return(e=h(e,t),3===t)?await L({endpoint:e,endpointAPIKey:n,signal:r,...a}):[]}async function*v({endpoint:e,endpointAPI:t,endpointAPIKey:n,signal:r,...a}){switch(e=h(e,t),t){case 0:return yield*await S({endpoint:e,endpointAPIKey:n,signal:r,...a});case 2:return yield*await P({endpoint:e,signal:r,...a});case 3:return yield*await O({endpoint:e,endpointAPIKey:n,signal:r,...a})}}async function b({endpoint:e,endpointAPI:t,...n}){switch(e=h(e,t),t){case 2:return await T({endpoint:e,...n});case 3:return await I({endpoint:e,...n})}}async function*w(e){let t="",n=!1;for await(let r of e.pipeThrough(new TextDecoderStream)){let e,a;n&&/^\n/.test(r)&&(r=r.slice(1)),n=/\r$/.test(r);let l=(t+r).split(/\n|\r\n?/);for(let n of(t=l.pop(),l)){if(!n){e=void 0,a=void 0;continue}let{name:t,value:r}=/^(?<name>.*?)(?:: ?(?<value>.*))?$/s.exec(n).groups;switch(t){case"event":e=r??"";break;case"data":a=void 0===a?r??"":`${a}
${r}`}if(a&&"message"===(e||"message")){if("[DONE]"===a)break;let t=JSON.parse(a);window.logSSEEvents&&console.log("event",t),yield t,e=void 0,a=void 0}}}}async function k({endpoint:e,endpointAPIKey:t,proxyEndpoint:n,signal:r,...a}){let l=await fetch(`${n??e}/tokenize`,{method:"POST",headers:{"Content-Type":"application/json",...t?{Authorization:`Bearer ${t}`}:{},...n?{"X-Real-URL":e}:{}},body:JSON.stringify(a),signal:r});if(!l.ok)throw Error(`HTTP ${l.status}`);let{tokens:o}=await l.json();return o.length+1}async function x({endpoint:e,endpointAPIKey:t,proxyEndpoint:n,signal:r,...a}){let l=await fetch(`${n??e}/tokenize`,{method:"POST",headers:{"Content-Type":"application/json",...t?{Authorization:`Bearer ${t}`}:{},...n?{"X-Real-URL":e}:{}},body:JSON.stringify(a),signal:r});if(!l.ok)throw Error(`HTTP ${l.status}`);let{tokens:o}=await l.json(),i=[];for(let n=0;n<o.length;n++){let a=await $({endpoint:e,endpointAPIKey:t,tokens:[o[n]],signal:r});i.push(a)}return{ids:o,str:i}}async function $({endpoint:e,endpointAPIKey:t,proxyEndpoint:n,signal:r,...a}){let l=await fetch(`${n??e}/detokenize`,{method:"POST",headers:{"Content-Type":"application/json",...t?{Authorization:`Bearer ${t}`}:{},...n?{"X-Real-URL":e}:{}},body:JSON.stringify(a),signal:r});if(!l.ok)throw Error(`HTTP ${l.status}`);let{content:o}=await l.json();return o}async function*S({endpoint:e,endpointAPIKey:t,proxyEndpoint:n,signal:r,...a}){let l=await fetch(`${n??e}/completion`,{method:"POST",headers:{"Content-Type":"application/json",...t?{Authorization:`Bearer ${t}`}:{},...n?{"X-Real-URL":e}:{}},body:JSON.stringify({...a,stream:!0,cache_prompt:!0}),signal:r});if(!l.ok)throw Error(`HTTP ${l.status}`);for await(let e of w(l.body)){let t=e.completion_probabilities[0]?.probs??[],n=t.find(t=>t.tok_str===e.content)?.prob;yield{content:e.content,...t.length>0?{prob:n??-1,completion_probabilities:e.completion_probabilities}:{}}}}async function E({endpoint:e,proxyEndpoint:t,signal:n,...r}){let a=await fetch(`${t??e}/api/extra/tokencount`,{method:"POST",headers:{"Content-Type":"application/json",...t?{"X-Real-URL":e}:{}},body:JSON.stringify({prompt:r.content}),signal:n});if(!a.ok)throw Error(`HTTP ${a.status}`);let{value:l}=await a.json();return l}async function C({endpoint:e,proxyEndpoint:t,signal:n,...r}){let a=await fetch(`${t??e}/api/extra/tokencount`,{method:"POST",headers:{"Content-Type":"application/json",...t?{"X-Real-URL":e}:{}},body:JSON.stringify({prompt:r.content}),signal:n});if(!a.ok)throw Error(`HTTP ${a.status}`);let{ids:l}=await a.json();return l.shift(),{ids:l,str:""}}async function*P({endpoint:e,proxyEndpoint:t,signal:n,...r}){let a=await fetch(`${t??e}/api/extra/generate/stream`,{method:"POST",headers:{"Content-Type":"application/json",...t?{"X-Real-URL":e}:{}},body:JSON.stringify({...function(e){let t=(t,n)=>{t in e&&(e[n]=e[t],delete e[t])};return -1===e.n_predict&&(e.n_predict=1024),t("n_ctx","max_context_length"),t("n_predict","max_length"),t("repeat_penalty","rep_pen"),t("repeat_last_n","rep_pen_range"),t("tfs_z","tfs"),t("typical_p","typical"),t("seed","sampler_seed"),t("stop","stop_sequence"),t("ignore_eos","use_default_badwordsids"),e}(r),stream:!0}),signal:n});if(!a.ok)throw Error(`HTTP ${a.status}`);for await(let e of w(a.body))yield{content:e.token}}async function T({endpoint:e,proxyEndpoint:t,...n}){try{await fetch(`${t??e}/api/extra/abort`,{method:"POST",headers:{...t?{"X-Real-URL":e}:{}}})}catch(e){reportError(e)}}async function F({endpoint:e,endpointAPIKey:t,proxyEndpoint:n,signal:r,...a}){try{let l=await fetch(`${n??e}/v1/token/encode`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`,...n?{"X-Real-URL":e}:{}},body:JSON.stringify({prompt:a.content}),signal:r});if(!l.ok)throw Error(`HTTP ${l.status}`);return(await l.json()).length}catch(e){return -1}}async function N({endpoint:e,proxyEndpoint:t,signal:n,...r}){try{let a=await fetch(`${t??e}/v1/internal/token-count`,{method:"POST",headers:{"Content-Type":"application/json",...t?{"X-Real-URL":e}:{}},body:JSON.stringify({text:r.content}),signal:n});if(!a.ok)throw Error(`HTTP ${a.status}`);let{length:l}=await a.json();return l}catch(e){return -1}}async function A({endpoint:e,endpointAPIKey:t,proxyEndpoint:n,signal:r,...a}){try{let l=await fetch(`${n??e}/v1/token/encode`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`,...n?{"X-Real-URL":e}:{}},body:JSON.stringify({text:a.content}),signal:r});if(!l.ok)throw Error(`HTTP ${l.status}`);return(await l.json()).length}catch(e){return -1}}async function _({endpoint:e,endpointAPIKey:t,proxyEndpoint:n,signal:r,...a}){try{let l=await fetch(`${n??e}/v1/internal/encode`,{method:"POST",headers:{"Content-Type":"application/json",...n?{"X-Real-URL":e}:{}},body:JSON.stringify({text:a.content}),signal:r});if(!l.ok)throw Error(`HTTP ${l.status}`);let{tokens:o}=await l.json(),i=[];for(let n=0;n<o.length;n++){let a=await D({endpoint:e,...t?{endpointAPIKey:t}:{},tokens:[o[n]],signal:r});i.push(a)}return{ids:o,str:i}}catch(e){return reportError(e),-1}}async function D({endpoint:e,endpointAPIKey:t,proxyEndpoint:n,signal:r,...a}){let l=await fetch(`${n??e}/v1/internal/decode`,{method:"POST",headers:{"Content-Type":"application/json",...n?{"X-Real-URL":e}:{}},body:JSON.stringify(a),signal:r});if(!l.ok)throw Error(`HTTP ${l.status}`);let{text:o}=await l.json();return o}async function L({endpoint:e,endpointAPIKey:t,proxyEndpoint:n,signal:r,...a}){let l=e.toLowerCase().includes("together.xyz"),o=await fetch(`${n??e}/v1/models`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`,...n?{"X-Real-URL":e}:{}},signal:r});if(!o.ok)throw Error(`HTTP ${o.status}`);let i=await o.json();return(l?i:i.data).map(e=>e.id)}async function*O({endpoint:e,endpointAPIKey:t,proxyEndpoint:n,signal:r,...a}){let l=await fetch(`${n??e}/v1/completions`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`,...n?{"X-Real-URL":e}:{}},body:JSON.stringify({...function(e,t){let n=t.toLowerCase().includes("openai.com"),r=t.toLowerCase().includes("together.xyz"),a=(t,n)=>{t in e&&(e[n]=e[t],delete e[t])};return -1===e.n_predict&&(e.n_predict=1024),n&&e.n_probs>5&&(e.n_probs=5),r&&e.n_probs>1&&(e.n_probs=1),"dynatemp_range"in e&&0!==e.dynatemp_range&&(e.dynamic_temperature=!0,e.dynatemp_low=Math.max(0,e.temperature-e.dynatemp_range),e.dynatemp_high=Math.max(0,e.temperature+e.dynatemp_range)),n||0!==e.temperature||(e.do_sample=!1),a("n_ctx","max_context_length"),a("n_predict","max_tokens"),a("n_probs","logprobs"),a("repeat_penalty","repetition_penalty"),a("repeat_last_n","repetition_penalty_range"),a("tfs_z","tfs"),a("mirostat","mirostat_mode"),a("ignore_eos","ban_eos_token"),e}(a,e),stream:!0}),signal:r});if(!l.ok)throw Error(`HTTP ${l.status}`);for await(let e of w(l.body)){if(!e.choices||0===e.choices.length)continue;let{text:t,logprobs:n}=e.choices[0],r=Object.entries(n?.top_logprobs?.[0]??{}).map(([e,t])=>({tok_str:e,prob:Math.exp(t)})),a=r.find(e=>e.tok_str===t)?.prob;yield{content:t,...r.length>0?{prob:a??-1,completion_probabilities:[{content:t,probs:r}]}:{}}}}async function I({endpoint:e,proxyEndpoint:t,...n}){try{await fetch(`${t??e}/v1/internal/stop-generation`,{method:"POST",headers:{...t?{"X-Real-URL":e}:{}}})}catch(e){}}function B({label:e,className:t,tooltip:n,tooltipSize:r,value:a,type:l,datalist:o,onValueChange:i,children:u,...s}){return d`
		<label className="InputBox ${n?"tooltip":""}">
			${e}
			<div className="${u?"hbox-flex":""}">
				<input
					className="flex1 ${t}"
					type=${l||"text"}
					list="${o?e:""}"
					value=${a}
					size="1"
					onChange=${({target:e})=>{let t="number"===l?e.valueAsNumber:e.value;"numeric"===s.inputmode&&(s.pattern="^-?[0-9]*$",t&&!isNaN(+t)&&(t=+e.value)),(!s.pattern||new RegExp(s.pattern).test(t))&&i(t)}}
					...${s}/>
				${u}
			</div>
			${o&&d`
				<datalist id="${e}">
					${o.map(e=>d`
						<option key="${e}">
							${e}
						</option>`)}
				</datalist>`}
			${n&&d`
				<span class="tooltiptext ${r||""}">
					${n}
				</span>`}
		</label>`}function z({label:e,value:t,onValueChange:n,options:r,...a}){return d`
		<label className="SelectBox">
			${e}
			<select
				value=${t}
				onChange=${({target:e})=>n(JSON.parse(e.value))}
				...${a}>
				${(r="function"==typeof r?r():r).map(e=>d`<option
					key=${JSON.stringify(e.value)}
					value=${JSON.stringify(e.value)}>${e.name}</option>`)}
			</select>
		</label>`}function M({label:e,value:t,onValueChange:n,options:r,...a}){return d`
		<label className="SelectBox">
			${e}
			<select
				value=${t}
				onChange=${({target:e})=>n(JSON.parse(JSON.stringify(e.value)))}
				...${a}>
				${(r="function"==typeof r?r():r).map(e=>d`<option
					key=${JSON.stringify(e.value)}
					value=${e.nameNew}>${e.nameNew}</option>`)}
			</select>
		</label>`}function R({label:e,value:t,onValueChange:n,...r}){return d`
		<label className="Checkbox">
			<input
				type="checkbox"
				checked=${t}
				onChange=${({target:e})=>n(e.checked)}
				...${r}/>
			${e}
		</label>`}function j({label:e,stateLabel:t,expanded:n,children:r}){let a=(0,i.useRef)(null),[l,o]=e$(`(${t||e}).isCollapsed`,!n),[u,s]=(0,i.useState)(l?0:"");(0,i.useEffect)(()=>{s(a.current.scrollHeight);let e=new f(()=>{s(a.current.scrollHeight)});return e.observe(a.current),()=>e.disconnect()},[]),(0,i.useEffect)(()=>{s(a.current.scrollHeight)},[l]);let c=d`<${J}/>`,p=d`<${q}/>`;return d`
		<div className="collapsible-group">
			<div className="collapsible-header" onClick=${()=>o(!l)}>
				${l?c:p}
				${e}
			</div>
			<div
				ref=${a}
				className="collapsible-content ${l?"collapsed":"expanded"}"
				style=${{"max-height":l?0:u}}>
				${r}
			</div>
		</div>`}function V({sessionStorage:e,disabled:t}){let[n,r]=(0,i.useState)(0),[a,l]=(0,i.useState)(""),[o,u]=(0,i.useState)(""),[s,c]=(0,i.useState)(void 0),[f,h]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let t=()=>r(e=>e+1);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let m=async t=>{e.selectedSession!=t&&await e.switchSession(t)},y=(e,t)=>{u(t),c(e)},g=async t=>{o&&(await e.renameSession(t,o),c(void 0))},v=async t=>{await e.deleteSession(t)},b=async()=>{if(a){let t=await e.createSession(a);await e.switchSession(t),h(!1)}},w=async()=>{let t={...e.sessions[e.selectedSession]};for(let[e,n]of Object.entries(t))t[e]=JSON.stringify(n);let n=await e.createSessionFromObject(t,!0);await e.switchSession(n)};function k(e,t){"Enter"===event.key?f?b():void 0!==s&&g(e):"Escape"===event.key&&(f?h(!1):void 0!==s&&c(void 0))}return d`
		<div className="Sessions ${t?"disabled":""}">
			<ul>
				${f&&d`
					<li key=-1>
						<a className="Session">
							<input
								type="text"
								value=${a}
								onChange=${e=>l(e.target.value)}
								onKeyDown=${e=>k(void 0,e.key)}
								onClick=${e=>e.stopPropagation()}
								autoFocus
							/>
							<div className="flex-separator"></div>
							<button onClick=${e=>(b(),e.stopImmediatePropagation?.())}><${W}/></button>
							<button onClick=${e=>(h(!1),e.stopImmediatePropagation?.())}><${K}/></button>
						</a>
					</li>
				`}
				${Object.entries(e.sessions).reverse().map(([t,n])=>d`
					<li key=${t}>
						<a className="Session ${e.selectedSession==t?"selected":""}"
							onClick=${()=>m(+t)}>
							${s==t?d`
								<input
									type="text"
									value=${o}
									onChange=${e=>u(e.target.value)}
									onKeyDown=${e=>k(+t,e.key)}
									onClick=${e=>e.stopPropagation()}
									autoFocus
								/>
								<div className="flex-separator"></div>
								<button onClick=${e=>(g(+t),e.stopImmediatePropagation())}><${W}/></button>
								<button onClick=${e=>(c(void 0),e.stopImmediatePropagation())}><${K}/></button>
							`:d`
								${n.name}
								<div className="flex-separator"></div>
								<button
									onClick=${e=>(y(+t,n.name),e.stopPropagation())}>
									<${X}/>
								</button>
								<button
									onClick=${e=>(v(+t),e.stopPropagation())}>
									<${Q}/>
								</button>
							`}
						</a>
					</li>
				`)}
			</ul>
			<div className="vbox">
				<button disabled=${t} onClick=${()=>{l(`MikuPad #${e.nextId+1}`),h(!0)}}>Create</button>
				<button disabled=${t} onClick=${()=>{let t=document.createElement("input");t.type="file",t.style.display="none",t.onchange=e=>{let n=e.target.files[0];if(!n)return;let r=new FileReader;r.onload=e=>{let n=e.target.result;t.func(n)},r.readAsText(n)},t.func=async t=>{let n=await e.createSessionFromObject(JSON.parse(t),!1);await e.switchSession(n)},document.body.appendChild(t),t.click(),document.body.removeChild(t)}}>Import</button>
				<button disabled=${t} onClick=${()=>{let t={...e.sessions[e.selectedSession]};for(let[e,n]of Object.entries(t))t[e]=JSON.stringify(n);p(`${e.getProperty("name")}.json`,JSON.stringify(t))}}>Export</button>
				<button disabled=${t} onClick=${w}>Clone</button>
			</div>
		</div>`}Symbol.asyncIterator in ReadableStream.prototype||(ReadableStream.prototype[Symbol.asyncIterator]=async function*(){let e=this.getReader();try{for(;;){let{done:t,value:n}=await e.read();if(t)return;yield n}}finally{e.releaseLock()}});const U=({stroke:e="currentColor",fill:t="currentColor",strokeWidth:n="0",children:r,...a})=>d`
	<svg
		xmlns="http://www.w3.org/2000/svg"
		fill=${t}
		stroke=${e}
		strokeWidth=${n}
		...${a}
	>
		${r}
	</svg>
`,H=({...e})=>d`
	<${U}
		viewBox="-1 -1 10 10">
		<path d="M 0 1 L 3 4 L 0 7 L 1 8 L 4 5 L 7 8 L 8 7 L 5 4 L 8 1 L 7 0 L 4 3 L 1 0 L 1 0 Z"/>
	</${U}>
`,W=({...e})=>d`
	<${U}
		width="16"
		height="16"
		viewBox="0 0 128 128">
		<circle cx="64" cy="64" r="64" fill="var(--color-dark)"/>
		<path d="M54.3 97.2 24.8 67.7c-.4-.4-.4-1 0-1.4l8.5-8.5c.4-.4 1-.4 1.4 0L55 78.1l38.2-38.2c.4-.4 1-.4 1.4 0l8.5 8.5c.4.4.4 1 0 1.4L55.7 97.2c-.4.4-1 .4-1.4 0z"/>
	</${U}>
`,K=({...e})=>d`
	<${U}
		width="16"
		height="16"
		viewBox="0 0 128 128">
		<circle cx="64" cy="64" r="64" fill="var(--color-dark)"/>
		<path d="M100.3 90.4 73.9 64l26.3-26.4c.4-.4.4-1 0-1.4l-8.5-8.5c-.4-.4-1-.4-1.4 0L64 54.1 37.7 27.8c-.4-.4-1-.4-1.4 0l-8.5 8.5c-.4.4-.4 1 0 1.4L54 64 27.7 90.3c-.4.4-.4 1 0 1.4l8.5 8.5c.4.4 1.1.4 1.4 0L64 73.9l26.3 26.3c.4.4 1.1.4 1.5.1l8.5-8.5c.4-.4.4-1 0-1.4z"/>
	</${U}>
`,Q=({...e})=>d`
	<${U}
		width="16"
		height="16"
		viewBox="0 0 490.646 490.646">
		<path d="m399.179 67.285-74.794.033L324.356 0 166.214.066l.029 67.318-74.802.033.025 62.914h307.739l-.026-63.046zM198.28 32.11l94.03-.041.017 35.262-94.03.041-.017-35.262zM91.465 490.646h307.739V146.359H91.465v344.287zm225.996-297.274h16.028v250.259h-16.028V193.372zm-80.14 0h16.028v250.259h-16.028V193.372zm-80.141 0h16.028v250.259H157.18V193.372z"/>
	</${U}>
`,X=({...e})=>d`
	<${U}
		width="16"
		height="16"
		viewBox="0 0 512 448">
		<path style=${{strokeLinecap:"round",strokeMiterlimit:4}} d="M0 96v256h320v-32H32V128h288V96H0zM416 96v32h64v192h-64v32h96V96h-96z" />
		<path style=${{strokeLinecap:"round",strokeMiterlimit:4}} d="M352 636.362h32v384h-32z" transform="matrix(1, 0, 0, 1, 0, -604.3619995117188)" />
		<path style=${{strokeLinecap:"round",strokeMiterlimit:4}} transform="matrix(0, 1, -1, 0, 0, -604.3619995117188)" d="M1020.362-448h32v64h-32zM1020.362-352h32v64h-32zM604.362-448h32v64h-32zM604.362-352h32v64h-32zM764.362-288h128v224h-128z" />
	</${U}>
`,q=({...e})=>d`
	<${U}
		...${e}
		viewBox="0 0 330 330"
		width="12"
		height="12">
		<path d="M325.606,229.393l-150.004-150C172.79,76.58,168.974,75,164.996,75c-3.979,0-7.794,1.581-10.607,4.394 l-149.996,150c-5.858,5.858-5.858,15.355,0,21.213c5.857,5.857,15.355,5.858,21.213,0l139.39-139.393l139.397,139.393 C307.322,253.536,311.161,255,315,255c3.839,0,7.678-1.464,10.607-4.394C331.464,244.748,331.464,235.251,325.606,229.393z"/>
	</${U}>
`,J=({...e})=>d`
	<${q}
		...${e}
		style=${{transform:"rotate(180deg)"}}/>
`,Y=({...e})=>d`
	<${U}
		...${e}
		viewBox="-1 -5 8 7">
		<path d="M0 0 3-3C3-4 3-5 5-5L4-4 5-3 6-4C6-2 5-2 4-2L1 1C0 2-1 1 0 0"/>
	</${U}>
`,G=({...e})=>d`
	<${U}
		...${e}
		transform="translate(0, 2)"
		width="16"
		height="16"
		viewBox="0 0 512 512">
		<path d="M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"/>
	</${U}>
`,Z=({...e})=>d`
	<${U}
		...${e}
		width="16"
		height="16"
		viewBox="0 0 24 24">
		<path d="M15 12c0 1.654-1.346 3-3 3s-3-1.346-3-3 1.346-3 3-3 3 1.346 3 3zm9-.449s-4.252 8.449-11.985 8.449c-7.18 0-12.015-8.449-12.015-8.449s4.446-7.551 12.015-7.551c7.694 0 11.985 7.551 11.985 7.551zm-7 .449c0-2.757-2.243-5-5-5s-5 2.243-5 5 2.243 5 5 5 5-2.243 5-5z"/>
	</${U}>
`,ee=({...e})=>d`
	<${U}
		...${e}
		width="16"
		height="16"
		viewBox="0 0 24 24">
		<path d="M11.885 14.988l3.104-3.098.011.11c0 1.654-1.346 3-3 3l-.115-.012zm8.048-8.032l-3.274 3.268c.212.554.341 1.149.341 1.776 0 2.757-2.243 5-5 5-.631 0-1.229-.13-1.785-.344l-2.377 2.372c1.276.588 2.671.972 4.177.972 7.733 0 11.985-8.449 11.985-8.449s-1.415-2.478-4.067-4.595zm1.431-3.536l-18.619 18.58-1.382-1.422 3.455-3.447c-3.022-2.45-4.818-5.58-4.818-5.58s4.446-7.551 12.015-7.551c1.825 0 3.456.426 4.886 1.075l3.081-3.075 1.382 1.42zm-13.751 10.922l1.519-1.515c-.077-.264-.132-.538-.132-.827 0-1.654 1.346-3 3-3 .291 0 .567.055.833.134l1.518-1.515c-.704-.382-1.496-.619-2.351-.619-2.757 0-5 2.243-5 5 0 .852.235 1.641.613 2.342z"/>
	</${U}>
`,et=({...e})=>d`
	<${U}
		...${e}
		viewBox="0 -10 10 10">
		<path d="M 0 -2 L 1 -1 L 5 -5 L 1 -9 L 0 -8 L 3 -5 L 0 -2 M 4 -1 L 10 -1 L 10 -2.4 L 4 -2.4"/>
	</${U}>
`,en=({...e})=>d`
	<${U}
		...${e}
		viewBox="0 -10 5 10">
		<path d="M 2.5 -6 A 0.75 0.75 90 0 0 3.25 -6.75 A 0.75 0.75 90 0 0 2.5 -7.5 A 0.75 0.75 90 0 0 1.75 -6.75 A 0.75 0.75 90 0 0 2.5 -6 M 1 0 L 4 0 L 4 -1 L 3 -1 L 3 -5 L 1 -5 L 1 -4 L 2 -4 L 2 -1 L 1 -1 Z"/>
	</${U}>
`,er=({...e})=>d`
	<${U}
		...${e}
		viewBox="0 0 10 10">
		<path d="M 2 10 L 2 7 Q 0 7 0 5 L 0 2 Q 0 0 2 0 L 8 0 Q 10 0 10 2 Q 10 2 10 3 L 10 5 Q 10 7 8 7 L 6 7 Z"/>
	</${U}>
`,ea=({...e})=>d`
	<${U}
		...${e}
		viewBox="2 -1 34 28">
		<path d="M 3 25 L 3 4 C 9 1 15 2 18 6 C 21 2 27 1 33 4 L 33 25 C 27 22 21 23 18 26 C 15 23 9 22 3 25 Z"/>
	</${U}>
`,el=({...e})=>d`
	<${U}
		...${e}
		viewBox="0 0 40.499 40.5"
		width="12"
		height="12">
		<path d="M39.622,21.746l-6.749,6.75c-0.562,0.562-1.326,0.879-2.122,0.879s-1.56-0.316-2.121-0.879l-6.75-6.75		c-1.171-1.171-1.171-3.071,0-4.242c1.171-1.172,3.071-1.172,4.242,0l1.832,1.832C27.486,13.697,22.758,9.25,17,9.25		c-6.064,0-11,4.935-11,11c0,6.064,4.936,11,11,11c1.657,0,3,1.343,3,3s-1.343,3-3,3c-9.373,0-17-7.626-17-17s7.627-17,17-17		c8.936,0,16.266,6.933,16.936,15.698l1.442-1.444c1.172-1.172,3.072-1.172,4.242,0C40.792,18.674,40.792,20.574,39.622,21.746z"/>
	</${U}>
`,eo=({...e})=>d`
	<${U}
		...${e}
		viewBox="0 0 24 24"
		width="12"
		height="12">
		<path d="M17.026 22.957c10.957-11.421-2.326-20.865-10.384-13.309l2.464 2.352h-9.106v-8.947l2.232 2.229c14.794-13.203 31.51 7.051 14.794 17.675z"/>
	</${U}>
`,ei=({...e})=>d`
	<${eo}
		...${e}
		style=${{transform:"scaleX(-1)"}}/>
`;function eu({isOpen:e,onClose:t,title:n,description:r,children:a,...l}){return e?((0,i.useEffect)(()=>{let e=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[]),d`
		<div className="modal-overlay" onClick=${t}>
			<div className="modal-container">
				<div className="modal" onClick=${e=>e.stopPropagation()} ...${l}>
					<div class="modal-title">${n}</div>
					${""!=r&&d`<div style=${{whiteSpace:"pre-line"}} class='modal-desc'>${r}</div>`}
					<hr/>
					<div className="modal-content">
						${a}
					</div>
					<button
					class="button-modal-top"
					onClick=${t}>
						<${H}/>
					</button>
				</div>
			</div>
		</div>`):null}function es({isOpen:e,closeModal:t,children:n}){return d`
		<${eu} isOpen=${e} onClose=${t}
			title="Editor Preferences"
			description=""
			style=${{"max-width":"20em"}}>
				<div className="vbox">
					${n}
				</div>
		</${eu}>`}function ec({isOpen:e,closeModal:t,memoryTokens:n,handleMemoryTokensChange:r,cancel:a}){return d`
		<${eu} isOpen=${e} onClose=${t}
			title="Memory"
			description="This text will be added at the very top of your context.
			Prefix and suffix will be attached at the beginning or end of your memory respectively. \\n for newlines in pre/suffix.">
				<div className="hbox">
					<${B} label="Prefix" type="text" placeholder="[INST]"
						readOnly=${!!a} value=${n.prefix} onValueChange=${e=>r("prefix",e)}/>
					<${B} label="Suffix" type="text" placeholder="[/INST]"
						readOnly=${!!a} value=${n.suffix} onValueChange=${e=>r("suffix",e)}/>
				</div>
				<div class="relative">
					<textarea
						readOnly=${!!a}
						placeholder="Anything written here will be injected at the head of the prompt. Tokens here DO count towards the Context Limit."
						defaultValue=${n.text}
						value=${n.text}
						onInput=${e=>r("text",e.target.value)}
						class="expanded-text-area-settings"
						id="memory-area-settings"/>
					<div class="token-counter">
						${n.tokens}
					</div>
				</div>
			</${eu}>`}function ed({isOpen:e,closeModal:t,authorNoteTokens:n,handleauthorNoteTokensChange:r,authorNoteDepth:a,setAuthorNoteDepth:l,cancel:o}){return d`
		<${eu} isOpen=${e} onClose=${t}
			title="Author's Note"
			description="This text will be injected N newlines from the bottom of your prompt.
			Prefix and suffix will be attached at the beginning or end of your author's note respectively. \\n for newlines in pre/suffix.">
				<div className="hbox">
					<${B} label="Prefix" type="text" placeholder="[INST]"
						readOnly=${!!o} value=${n.prefix} onValueChange=${e=>r("prefix",e)}/>
					<${B} label="Suffix" type="text" placeholder="[/INST]"
						readOnly=${!!o} value=${n.suffix} onValueChange=${e=>r("suffix",e)}/>
					<${B} label="AN Injection Depth (0-N)" type="number" step="1"
						readOnly=${!!o} value=${a} onValueChange=${e=>{l(!isNaN(+e)&&e>=0?e:0)}}/>
				</div>
				<div class="relative">
					<textarea
						readOnly=${!!o}
						placeholder="Anything written here will be injected ${a} newlines from bottom into context."
						defaultValue=${n.text}
						value=${n.text}
						onInput=${e=>r("text",e.target.value)}
						class="expanded-text-area-settings"
						id="expanded-an-settings"/>
					<div class="token-counter">
						${n.tokens}
					</div>
				</div>
			</${eu}>`}function ef({isOpen:e,closeModal:t,tokens:n,memoryTokens:r,authorNoteTokens:a,handleMemoryTokensChange:l,finalPromptText:o,defaultPresets:i,cancel:u}){return d`
		<${eu} isOpen=${e} onClose=${t}
			title="Context"
			description="This is the prompt being sent to your large language model.">
			<div id="advancedContextPlaceholders">
			<table id="contextTokensTable" border="1" frame="void" rules="all">
				<thead>
					<tr>
						<th></th>
						<th>Memory</th>
						<th>World Info</th>
						<th>Author's Note</th>
						<th>Prompt</th>
						<th></th>
						<th>Total</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<th>Tokens</th>
						<td>${r.tokens}</td>
						<td>${r.tokensWI}</td>
						<td>${a.tokens}</td>
						<td>${n-a.tokens-r.tokensWI-r.tokens}</td>
						<td></td>
						<td>${n}</td>
					</tr>
				</tbody>
			</table>
			</div>
			<${j} label="Advanced Context Ordering">
				<div id="context-order-desc">
					You can use the following placeholders to order the context according to your needs:<br />
					<div id="advancedContextPlaceholders">
						<table border="1" frame="void" rules="all">
							<thead>
							<tr>
								<th></th>
								<th>Prefix</th>
								<th>Text</th>
								<th>Suffix</th>
							</tr>
							</thead>
							<tbody>
							<tr>
								<th>Memory</th>
								<td>{memPrefix}</td>
								<td>{memText}</td>
								<td>{memSuffix}</td>
							</tr>
							<tr>
								<th>World Info</th>
								<td>{wiPrefix}</td>
								<td>{wiText}</td>
								<td>{wiSuffix}</td>
							</tr>
							<tr>
								<th>Prompt</th>
								<td></td>
								<td>{prompt}</td>
								<td></td>
							</tr>
							</tbody>
						</table>
					</div>
					Any text that is not a placeholder will be added into the context as is.
				</div>
				<textarea
					readOnly=${!!u}
					placeholder=${i.memoryTokens.contextOrder}
					defaultValue=${r.contextOrder}
					value=${r.contextOrder}
					onInput=${e=>l("contextOrder",e.target.value)}
					class="expanded-text-area-settings"
					id="advanced-context-order-settings"/>
			</${j}>
			<textarea
				readOnly=${!!u}
				value=${o}
				class="expanded-text-area-settings"
				id="context-area-settings" readOnly/>
		</${eu}>`}function ep({isOpen:e,closeModal:t,worldInfo:n,setWorldInfo:r,cancel:a}){let l=(e,t)=>{let a=n.entries;e+t<0||e+t>a.length-1||(a.splice(e+t,0,a.splice(e,1)[0]),r(e=>({...e,entries:[...a]})))},o=e=>{window.confirm("Are you sure you want to delete the world info entry #"+(e+1)+": "+n.entries[e].displayName+"?\nThis action cannot be undone.")&&(e>-1&&e<n.entries.length?r(t=>(console.warn(`Deleting world info entry #${e+1}:`,t.entries[e]),{...t,entries:t.entries.filter((t,n)=>n!==e)})):alert("Index "+e+" out of range!"))},i=(e,t,n)=>{r(r=>{let a=[...r.entries],l="keys"==e?{...a[t],[e]:n.split(/(?<!\\), ?/)}:{...a[t],[e]:n};return a[t]=l,{...r,entries:a}})},u=(e,t)=>{r(n=>({...n,[e]:t}))};return d`
		<${eu} isOpen=${e} onClose=${t}
			title="World Info"
			description="Additional information that is added when specific keywords are found in context.
			World info will be added at the top of your memory, in the order specified here.

			Each entry will begin on a newline. Keys will be interpreted as case-insensitive regular expressions. Search Range specifies how many tokens back into the context will be searched for activation keys. Search range 0 to disable an entry.">
			<div id="modal-wi-global">
				<${j} label="Prefix/Suffix" stateLabel="Prefix/Suffix-WI">
					The prefix and suffix will be added at the beginning or end of all your active World Info entries respectively.
					<br />
					<div className="hbox">
						<${B} label="Prefix" type="text" placeholder="\\n"
							readOnly=${!!a} value=${n.prefix} onValueChange=${e=>u("prefix",e)}/>
						<${B} label="Suffix" type="text" placeholder="\\n"
							readOnly=${!!a} value=${n.suffix} onValueChange=${e=>u("suffix",e)}/>
					</div>
				</${j}>
				<button id="button-wi-new" disabled=${!!a} onClick=${()=>{r(e=>({...e,entries:[{displayName:"New Entry",text:"",keys:[],search:""},...e.entries]}))}}>New Entry</button>
			</div>
			<div className="modal-wi-content overflow-container">
				${Array.isArray(n.entries)?n.entries.map((e,t)=>d`
					<div class="wi-entry" key=${t}>
						<div class="wi-entry-controls">
							<div class="wi-entry-filler" />
							<div class="wi-entry-name">
								<${B}
								label="Entry #${t+1}"
								type="text"
								readOnly=${!!a}
								placeholder="Name of this entry"
								value=${e.displayName}
								onValueChange=${e=>i("displayName",t,e)}
								/>
							</div>
							<div class="wi-entry-buttons">
								<div class="wi-entry-buttons-container">
									<button disabled=${!!a} onClick=${()=>l(t,-1)}>
										<${q}/>
									</button>
									<button disabled=${!!a} onClick=${()=>o(t)}>
										✕
									</button>
									<button disabled=${!!a} onClick=${()=>l(t,1)}>
										<${J}/>
									</button>
								</div>
							</div>
							<div class="wi-entry-text">
								<div class="hbox">
									<${B}
										label="Comma Separated RegEx Keys"
										type="text"
										readOnly=${!!a}
										value=${e.keys.join(",")}
										placeholder="Required to activate entry"
										onValueChange=${e=>i("keys",t,e)}
										/>
									<${B}
										label="Search Range (0 = disabled)"
										tooltip="Currently not accurate to the token count, it will be used as an estimate."

										type="text"
										readOnly=${!!a}
										inputmode="numeric"
										value=${e.search}
										placeholder="2048"
										onValueChange=${e=>i("search",t,e)}
										/>
								</div>
								<label class="TextArea">
									Text
									<textarea
										readOnly=${!!a}
										placeholder="Information to be inserted into context when key is found"
										value=${e.text?e.text:""}
										defaultValue=${e.text?e.text:""}
										onInput=${e=>i("text",t,e.target.value)}
										class="wi-textarea" />
								</label>
							</div>
						</div>
					</div>`):null}
			</div>
		</${eu}>`}function eh({isOpen:e,closeModal:t,logitBias:n,setLogitBias:r,logitBiasParam:a,setLogitBiasParam:l,sessionStorage:o,endpoint:u,endpointAPI:s,endpointAPIKey:c,isMikupadEndpoint:f,cancel:p}){let[h,m]=(0,i.useState)(void 0),[g,v]=(0,i.useState)([]),[b,w]=(0,i.useState)([]),[k,x]=(0,i.useState)({power:"0",string:""}),$=(e,t)=>{x(n=>({...n,[e]:t}))},S=async(e="",t="",a="")=>{if(m(void 0),!t)return;if(isNaN(+e)||""==e){m("Error: Bias must be a number");return}e=Number(e);let l=n.bias;if(0==e){if(!n.bias[t]){m("Error: Bias 0 = no Bias");return}console.log("delete",t),r(e=>(delete l[t],{...e,bias:{...l}}));return}a&&a!=t&&delete l[a];let i=new AbortController;try{var d;let n=t.match(/^(?<!\\)\/(\s*\d+\s*,?\s*)+(?<!\\)\/$/g);if(null!=n)d={ids:n[0].replaceAll("/","").split(",").map(e=>Number(e.trim())),str:""};else{d=await y({endpoint:u,endpointAPI:s,...3==s||0==s?{endpointAPIKey:c}:{},content:`!==${t}`.replace(/\\n/g,"\n"),signal:i.signal,...f?{proxyEndpoint:o.proxyEndpoint}:{}});let e=await y({endpoint:u,endpointAPI:s,...3==s||0==s?{endpointAPIKey:c}:{},content:"!==",signal:i.signal,...f?{proxyEndpoint:o.proxyEndpoint}:{}});d.ids=d.ids.slice(e.ids.length),Array.isArray(d.str)&&(d.str=d.str.slice(e.ids.length))}console.log("Biasing tokens [",d.ids.join(", "),"]",Array.isArray(d.str)?"'"+d.str.join("|")+"'":"'"+t+"'","by power",e),await r(n=>({...n,bias:{...l,[t]:{ids:[...d.ids],strings:[...d.str],power:e}}}))}catch(e){if("AbortError"!==e.name){reportError(e);let t=e.toString();(3==s||0==s)&&t.includes("401")?(m("Error: Rejected API Key"),setRejectedAPIKey(!0)):3==s&&t.includes("429")?m("Error: Insufficient Quota"):m(t)}return}},E=(e,t=-1/0,n=1/0)=>Math.min(Math.max(e,t),n),C=()=>{let e=[];Object.keys(n.bias).forEach(t=>{let r=!(n.bias[t].power<-99)&&Number(n.bias[t].power)/10;e.push([Number(n.bias[t].ids[0]),r])}),l(e)},P=()=>{let e={};Object.keys(n.bias).forEach(t=>{e[Number(n.bias[t].ids[0])]=E(Number(n.bias[t].power),-100,100)}),l(e)};(0,i.useMemo)(()=>{switch(s){case 0:C();break;case 2:P()}},[n,s]),(0,i.useEffect)(()=>{let e=b.map((e,t)=>({value:e,valueBack:e,strings:n.bias[e].strings,tokens:n.bias[e].ids,power:n.bias[e].power}));v({positive:e.filter(e=>e.power>0),negative:e.filter(e=>e.power<0)})},[b,e]);let T=(e,t,n,r)=>{v(a=>{let l={...a},o=[...a[e]];return o[n]={...o[n],[t]:r},{...l,[e]:o}})};return(0,i.useMemo)(()=>{w(Object.entries(n.bias).sort((e,t)=>{let n=parseInt(t[1].power)-parseInt(e[1].power);return 0!==n?n:e[0].localeCompare(t[0])}).map(([e])=>e))},[n]),d`
		<${eu} isOpen=${e} onClose=${t}
			title="Logit Bias"
			description="Make certain tokens more or less likely to be generated. Recommended ranges are 100 to -100, with -100 being a total ban of the token.
			Currently only works on the first token of multi-token phrases/words.
			You can bias IDs directly in a comma separated list, wrapped in '/'. Example: /382,1449,1802/

			Different models might tokenize words differently. Always Re-Tokenize your biases when switching models by pressing the '+' button again for every entry.">
			${e&&d`
					<div className="hbox-flex logitBiasContainer">
						<div class="small-inputBox">
							<${B} label="Bias" className="logitBiasPower-container"
								type="enumber"  max=100 min=-100 step=1
								readOnly=${!!p}
								onValueChange=${e=>{$("power",e)}}
								value=${k.power}
								id="logitBiasPower"/>
						</div>
						<${B} label="Token" type="text"
							tooltip="Currently, only the first token of multi-token strings will be biased."
							readOnly=${!!p}
							value=${k.string}
							placeholder="String or /ID,.../"
							onValueChange=${()=>{}}
							onInput=${e=>{$("string",e.target.value)}}
							/>
						<button disabled=${!!p} class="hbox-button" onClick=${()=>S(k.power,k.string)}>
							+
						</button>
					</div>
					${!!h&&d`
						<div style=${{margin:"8px auto"}} className="error-text">${h}</div>`}
				<hr style=${{width:"95%",margin:"8px auto"}} />
				<div class="lb-modal-biasList" >
					${Object.keys(g).map(e=>d`
							<div class="overflow-container lb-modal-grid-column" id="lb-modal-${e}">
								${g[e].map((t,n)=>d`
										<div class="lb-modal-entry lb-modal-grid-row" key=${n}>
											<${B} label="Bias" class="lb-modal-power"
												type="enumber" max=100 min=-100 step=1
												id="lb-modal-power-${n}"
												readOnly=${!!p}
												onValueChange=${t=>{T(e,"power",n,t)}}
												value=${t.power}/>

											<${B} label="Token" type="text"
												tooltip="Currently, only the first token of multi-token strings will be biased."
												readOnly=${!!p}
												value=${t.value}
												placeholder="String or /ID,.../"
												onValueChange=${()=>{}}
												onInput=${t=>T(e,"value",n,t.target.value)}
												/>
											<div class="lb-modal-tokenized">
												${0==s&&""!=t.strings?"["+t.strings.join("|")+"] ":"["+t.tokens+"]"}

											</div>
											<button
												disabled=${!!p}
												class="hbox-button lb-modal-button lb-modal-button-add"
												onClick=${()=>S(t.power,t.value,t.valueBack)}>
												+
											</button>
											<button
												disabled=${!!p}
												class="hbox-button lb-modal-button lb-modal-button-remove"
												onClick=${()=>S("0",t.valueBack,t.valueBack)}
												>
												-
											</button>
											<hr/>
										</div>`)}
							</div>`)}
				</div>`}
			</${eu}>`}function em({isOpen:e,closeModal:t,templateStorage:n,selectedTemplate:r,setSelectedTemplate:a,templateList:l,setTemplateList:o,templates:u,templatesImport:s,setTemplates:c,cancel:f}){let[h,m]=(0,i.useState)(!1),[y,g]=(0,i.useState)(!1),[v,b]=(0,i.useState)(void 0);function w(e,t,n=!1){let r=e.findIndex(e=>e.name===t);return n?r:e[-1==r?0:r]}function k(e,t,n,r=""){"name"==t&&b(n),o(r=>{let a=[...r],l=a.findIndex(t=>t.name===e),o=l<0?0:l;return"name"==t?a[o]={...a[o],nameNew:n}:a[o]={...a[o],affixes:{...a[o].affixes,[t]:n}},a})}async function x(){await E(),c(e=>{var t={...e};return t[""]={sysPre:"",sysSuf:"",instPre:"",instSuf:"",fimTemplate:void 0},{...t}}),m(!0)}async function $(){let e=l.findIndex(e=>e.name===r),t=l[e==-1?0:e]?.nameNew;await E(),await g(t+" (Duplicate)"),c(e=>{var n={...e};return n[t+" (Duplicate)"]={sysPre:u[r]?.sysPre,sysSuf:u[r]?.sysSuf,instPre:u[r]?.instPre,instSuf:u[r]?.instSuf,fimTemplate:u[r]?.fimTemplate},{...n}})}async function S(e){!(Object.keys(u).length<2)&&window.confirm("Are you sure you want to delete this template? This action can't be undone.")&&(console.warn("Deleting Template",e,":",u[e]),c(t=>{var n={...t};return delete n[e],{...n}}),m(!0))}(0,i.useEffect)(()=>{let e=l.findIndex(e=>e.name===r),t=l[e==-1?0:e]?.nameNew,n=[];for(let e in u)n.push({name:e,nameNew:e,value:e,nameBack:e,affixes:u[e]});n.sort((e,t)=>{var n=e.name.toLowerCase(),r=t.name.toLowerCase();return n<r?-1:n>r?1:0}),o(n),t&&a(t),y&&(a(y),g(!1))},[u,r,s]),(0,i.useEffect)(()=>{h&&(a(""),m(!1))},[h]);let E=async()=>{b(void 0),c(e=>{var t={...e};for(let n=0;n<l.length;n++){let r=l[n],a=r.nameNew,o=r.nameBack;void 0!==a&&void 0!==o&&(a!=o&&(t[a]=e[o],delete t[o]),t[a]={sysPre:r.affixes.sysPre,sysSuf:r.affixes.sysSuf,instPre:r.affixes.instPre,instSuf:r.affixes.instSuf,fimTemplate:r.affixes.fimTemplate})}return{...t}})};(0,i.useEffect)(()=>{E()},[e,r]);let C=()=>{p("instruct_templates.json",JSON.stringify(u))},P=async(e=!1)=>{if(e){if(!window.confirm("This will add all default templates, and overwrite any changes you made to the default templates. This action cannot be undone. Do you wish to continue?"))return;await n.saveTemplates(ek.instructTemplates,!0),window.location.reload();return}let t=document.createElement("input");t.type="file",t.style.display="none",t.onchange=e=>{let n=e.target.files[0];if(!n)return;let r=new FileReader;r.onload=e=>{let n=e.target.result;t.func(n)},r.readAsText(n)},t.func=async e=>{await n.saveTemplates(JSON.parse(e),!0),window.location.reload()},document.body.appendChild(t),t.click(),document.body.removeChild(t)};return w(l,r)&&d`
		<${eu} isOpen=${e} onClose=${t}
			title="Instruct Templates"
			description="Use placeholders to insert the selected prompt template formats when sending your prompt to the model.
			Placeholders are listed below. You can insert newlines with '\\n'.
			When Chat Mode is active, the 'Instruct Suffix' field of the current template will be added at the end of your prompt, before it is processed by the model. Similarly, the 'Instruct Prefix' field will be added at the end of the model's response.">
			<div id="advancedContextPlaceholders">
				<table border="1" frame="void" rules="all">
					<thead>
					<tr>
						<th></th>
						<th>Prefix</th>
						<th>Suffix</th>
					</tr>
					</thead>
					<tbody>
					<tr>
						<th>System Prompt</th>
						<td>{sys}</td>
						<td>{/sys}</td>
					</tr>
					<tr>
						<th>Instructions</th>
						<td>{inst}</td>
						<td>{/inst}</td>
					</tr>
					</tbody>
				</table>
			</div>
			<hr/>
			<div class="instructTemplatesImportExport">
				<button
					title="Import Instruct Templates"
					disabled=${!!f}
					onClick=${()=>P()}>
					Import
				</button>
				<button
					title="Export Instruct Templates"
					disabled=${!!f}
					onClick=${()=>C()}>
					Export
				</button>
				<button
					title="Re-Add Default Instruct Templates"
					disabled=${!!f}
					onClick=${()=>P(!0)}>
					Re-Add Defaults
				</button>
			</div>
			<div className="buttons instructTemplateSidebar">
				<${M}
					id="instructModalSelect"
					label="Instruct Template"
					disabled=${!!f}
					value=${v??r}
					onValueChange=${a}
					options=${l}/>
				<button
					title="Duplicate Currently Selected Instruct Template"
					disabled=${!!f}
					class="hbox-button"
					onClick=${()=>$()}>
					Duplicate
				</button>
				<button
					title="Add Instruct Template"
					disabled=${!!f}
					class="hbox-button"
					onClick=${()=>x()}>
					New
				</button>
				<button
					title="Delete Selected Instruct Template"
					disabled=${!!f}
					class="hbox-button"
					onClick=${()=>S(r)}>
					Delete
				</button>
			</div>
			<hr/>
			<div class="instructmodal-edits">
				<${B} label="Name"
						placeholder="Name of This Template"
						id="instructmodal-name"
						className=""
						tooltip=""
						readOnly=${!!f}
						value=${w(l,r).nameNew}
						onInput=${e=>k(r,"name",e.target.value,w(l,r).nameBack)}
						onValueChange=${()=>{}}/>

				<div className="hbox">
					<${B} label="Instruct Prefix {inst}"
						placeholder="[INST]"
						className=""
						tooltip=""
						readOnly=${!!f}
						value=${w(l,r)?.affixes.instPre||""}
						onInput=${e=>k(r,"instPre",e.target.value)}
						onValueChange=${()=>{}}/>

					<${B} label="Instruct Suffix {/inst}"
						placeholder="[/INST]"
						className=""
						tooltip=""
						readOnly=${!!f}
						value=${w(l,r)?.affixes.instSuf||""}
						onInput=${e=>k(r,"instSuf",e.target.value)}
						onValueChange=${()=>{}}/>
				</div>

				<div className="hbox">
					<${B} label="System Prompt Prefix {sys}"
						placeholder="<<SYS>>\n"
						className=""
						tooltip=""
						readOnly=${!!f}
						value=${w(l,r)?.affixes.sysPre||""}
						onInput=${e=>k(r,"sysPre",e.target.value)}
						onValueChange=${()=>{}}/>

					<${B} label="System Prompt Suffix {/sys}"
						placeholder="<</SYS>>\n\n"
						className=""
						tooltip=""
						readOnly=${!!f}
						value=${w(l,r)?.affixes.sysSuf||""}
						onInput=${e=>k(r,"sysSuf",e.target.value)}
						onValueChange=${()=>{}}/>
				</div>

				<div className="hbox">
					<div className="vbox">
						<${R} label="Supports Fill-In-The-Middle"
									value=${w(l,r)?.affixes.fimTemplate!==void 0}
									onValueChange=${e=>k(r,"fimTemplate",e?"":void 0)}/>
						${w(l,r)?.affixes.fimTemplate!==void 0&&d`
								<${B} label="Fill-In-The-Middle Template"
									placeholder="[SUFFIX]{suffix}[PREFIX]{prefix}"
									className=""
									tooltip=""
									readOnly=${!!f}
									value=${w(l,r)?.affixes.fimTemplate||""}
									onInput=${e=>k(r,"fimTemplate",e.target.value)}
									onValueChange=${()=>{}}/>`}
					</div>
					<div id="advancedContextPlaceholders">
						${w(l,r)?.affixes.fimTemplate!==void 0?d`
								<div>Use the <b>{fill}</b> placeholder to seamlessly apply the Fill-In-The-Middle template and start the prediction from that point.</div>
								<div><b>{prefix}</b> represents the text before the placeholder, and <b>{suffix}</b> represents the text after it.</div>`:d`
								<div>This template doesn't have a Fill-In-The-Middle template.</div>
								<div>You can use the <b>{predict}</b> placeholder to start the prediction from that point, but the model won't be aware of the text after the placeholder.</div>`}
					</div>
				</div>
			</div>


		</${eu}>`}class ey{constructor(){this.dbName="MikuPad"}async init(){}async openDatabase(){return new Promise((e,t)=>{let n=indexedDB.open(this.dbName,2);n.onerror=()=>t(n.error),n.onsuccess=()=>e(n.result),n.onupgradeneeded=e=>{let t=e.target.result;for(let e of["Sessions","Templates"])t.objectStoreNames.contains(e)||t.createObjectStore(e)},n.onblocked=()=>console.warn("Request was blocked")})}async loadFromDatabase(e,t,n){return new Promise((r,a)=>{let l=e.transaction(t,"readonly").objectStore(t).get(n);l.onsuccess=()=>r(l.result),l.onerror=()=>a(l.error)})}async loadAllFromDatabase(e,t){return new Promise((n,r)=>{let a=e.transaction(t,"readonly").objectStore(t).openCursor(),l={};a.onsuccess=async e=>{let t=e.target.result;t?(l[t.key]=t.value,t.continue()):n(l)},a.onerror=()=>r(a.error)})}async saveToDatabase(e,t,n,r){return new Promise((a,l)=>{let o=e.transaction(t,"readwrite").objectStore(t).put(r,n);o.onsuccess=()=>a(),o.onerror=()=>l(o.error)})}async deleteFromDatabase(e,t,n){return new Promise((r,a)=>{let l=e.transaction(t,"readwrite").objectStore(t).delete(n);l.onsuccess=()=>r(),l.onerror=()=>a(l.error)})}}class eg{constructor(e){this.sessionEndpoint=e}async init(){let e=await fetch(new URL("/version",this.sessionEndpoint),{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw Error("Not a mikupad server or version mismatch.");let{version:t}=await e.json();if(2!==t)throw Error("Mikupad server version mismatch.")}async openDatabase(){return async(e,t)=>{try{return await fetch(new URL(e,this.sessionEndpoint),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}catch(e){return reportError(e),{ok:!1,status:e.toString()}}}}async loadFromDatabase(e,t,n){return new Promise(async(r,a)=>{let l=await e("/load",{storeName:t,key:n});if(!l.ok){404==l.status?r(void 0):a(l.status);return}let{result:o}=await l.json();r(o)})}async loadAllFromDatabase(e,t){return new Promise(async(n,r)=>{let a=await e("/all",{storeName:t});if(!a.ok){r(a.status);return}let{result:l}=await a.json();n(l)})}async saveToDatabase(e,t,n,r){return new Promise(async(a,l)=>{let o=await e("/save",{storeName:t,key:n,data:r});if(!o.ok){l(o.status);return}let{result:i}=await o.json();a(i)})}async deleteFromDatabase(e,t,n){return new Promise(async(r,a)=>{let l=await e("/delete",{storeName:t,key:n});if(!l.ok){a(l.status);return}r()})}}class ev extends EventTarget{constructor(e,t){super(),this.storeName=e,this.dbAdapter=t,this.saveQueue=[],this.saveTimer=void 0}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("change"))}dispatchErrorEvent(e){this.dispatchEvent(new CustomEvent("error",{detail:e}))}startSaveTimer(e){this.saveTimer=setInterval(async()=>await this.saveTimerHandler(e),500)}async saveTimerHandler(e){let t=[];for(;this.saveQueue.length;)t.push(this.saveQueue.pop());for(let n of t)await e(n)}enqueueSave(e){this.saveQueue.includes(e)||this.saveQueue.push(e)}async openDatabase(){try{return await this.dbAdapter.openDatabase()}catch(e){throw this.dispatchErrorEvent(e),e}}async loadFromDatabase(e,t){try{return await this.dbAdapter.loadFromDatabase(e,this.storeName,t)}catch(e){throw this.dispatchErrorEvent(e),e}}async loadAllFromDatabase(e){try{return await this.dbAdapter.loadAllFromDatabase(e,this.storeName)}catch(e){throw this.dispatchErrorEvent(e),e}}async saveToDatabase(e,t,n){try{return await this.dbAdapter.saveToDatabase(e,this.storeName,t,n)}catch(e){throw this.dispatchErrorEvent(e),e}}async deleteFromDatabase(e,t){try{return await this.dbAdapter.deleteFromDatabase(e,this.storeName,t)}catch(e){throw this.dispatchErrorEvent(e),e}}}class eb extends ev{constructor(e){super("Templates",e),this.templates={}}async init(){let e=await this.openDatabase();await this.loadTemplates(e)}async saveTemplates(e,t=!1){let n=await this.openDatabase();for(let r of Object.keys(this.templates))if(!Object.keys(e).includes(r)&&!t)try{await this.deleteFromDatabase(n,r),console.warn("Deleted key:",r)}catch{console.error("Error deleting key:",r)}for(let[t,r]of Object.entries(e))JSON.stringify(r)!==JSON.stringify(this.templates[t])&&await this.saveToDatabase(n,t,r);this.templates=e}async loadTemplates(e){this.templates=await this.loadAllFromDatabase(e)}}class ew extends ev{constructor(e){super("Sessions",e),this.nextId=void 0,this.sessions={},this.selectedSession=void 0,e.sessionEndpoint&&(this.sessionEndpoint=e.sessionEndpoint,this.proxyEndpoint=`${e.sessionEndpoint}/proxy`)}dispatchSessionChangeEvent(){this.dispatchEvent(new CustomEvent("sessionchange"))}async init(){let e=await this.openDatabase();this.nextId=await this.loadFromDatabase(e,"nextSessionId")||0,this.selectedSession=await this.loadFromDatabase(e,"selectedSessionId")||0,await this.loadSessions(e),this.startSaveTimer(e=>this.saveSessionToDB(e))}async saveSessionToDB(e){if(!this.sessions[e])return;let t=await this.openDatabase();await this.saveToDatabase(t,e,this.sessions[e])}async getNewId(){let e=await this.openDatabase();return await this.saveToDatabase(e,"nextSessionId",this.nextId+1),this.nextId+=1,this.nextId-1}async migrateSessions(){let e=+localStorage.getItem("nextSessionId");if(0==e)return!1;for(let t of(this.nextId=e,this.selectedSession=+localStorage.getItem("selectedSessionId"),Object.keys(localStorage))){let[e,n]=t.split("/");if(void 0===n)continue;let r=localStorage.getItem(t);try{r=JSON.parse(r)}catch{continue}null!==r&&(this.sessions[e]=this.sessions[e]||{},this.sessions[e][n]=r)}let t=await this.openDatabase();for(let e of(await this.saveToDatabase(t,"nextSessionId",this.nextId),await this.saveToDatabase(t,"selectedSessionId",this.selectedSession),Object.keys(this.sessions)))await this.saveToDatabase(t,+e,this.sessions[e]);return!0}async loadSessions(e){for(let[t,n]of Object.entries(await this.loadAllFromDatabase(e)))"nextSessionId"!==t&&"selectedSessionId"!==t&&(this.sessions[t]=n);0!==Object.keys(this.sessions).length||await this.migrateSessions()||await this.createSession("MikuPad #1"),await this.switchSession(this.selectedSession)}getProperty(e){return this.sessions[this.selectedSession]?.[e]}setProperty(e,t){this.sessions[this.selectedSession]&&(this.sessions[this.selectedSession][e]=t,this.enqueueSave(this.selectedSession))}async switchSession(e){if(!this.sessions[e])return;let t=await this.openDatabase();await this.saveToDatabase(t,"selectedSessionId",+e),this.selectedSession=+e,this.dispatchChangeEvent(),this.dispatchSessionChangeEvent()}async renameSession(e,t){this.sessions[e].name=t;let n=await this.openDatabase();await this.saveToDatabase(n,e,this.sessions[e]),this.dispatchChangeEvent()}async deleteSession(e){if(1===Object.keys(this.sessions).length||!window.confirm("Are you sure you want to delete this session? This action can't be undone."))return;let t=await this.openDatabase();if(await this.deleteFromDatabase(t,e),e==this.selectedSession){let t=Object.keys(this.sessions).map(e=>+e),n=t.indexOf(e),r=t[n-1]??t[n+1];await this.switchSession(+r)}delete this.sessions[e],this.dispatchChangeEvent()}async createSession(e){let t=await this.getNewId();this.sessions[t]={name:e};let n=await this.openDatabase();return await this.saveToDatabase(n,t,this.sessions[t]),onchange?.(),t}async createSessionFromObject(e,t){let n=await this.getNewId();for(let[t,r]of(this.sessions[n]={},Object.entries(e)))"darkMode"!==t&&(this.sessions[n][t]=JSON.parse(r));this.sessions[n].hasOwnProperty("name")||(this.sessions[n].name=`MikuPad #${this.nextId+1}`),t&&!this.sessions[n].name.startsWith("Cloned")&&(this.sessions[n].name=`Cloned ${this.sessions[n].name}`);let r=await this.openDatabase();return await this.saveToDatabase(r,n,this.sessions[n]),onchange?.(),n}}const ek={endpoint:"http://127.0.0.1:8080",endpointAPI:0,endpointAPIKey:"",endpointModel:"",prompt:[{type:"user",content:`[INST] <<SYS>>
You are a talented writing assistant. Always respond by incorporating the instructions into expertly written prose that is highly detailed, evocative, vivid and engaging.
<</SYS>>

Write a story about Hatsune Miku and Kagamine Rin. [/INST]  Sure, how about this:

Chapter 1
`}],seed:-1,maxPredictTokens:-1,temperature:.7,dynaTempRange:0,dynaTempExp:1,repeatPenalty:1.1,repeatLastN:256,penalizeNl:!1,presencePenalty:0,frequencyPenalty:0,topK:40,topP:.95,typicalP:1,minP:0,tfsZ:1,mirostat:0,mirostatTau:5,mirostatEta:.1,stoppingStrings:"[]",ignoreEos:!1,openaiPresets:!1,contextLength:8192,tokenRatio:3.3,memoryTokens:{contextOrder:"{memPrefix}{wiPrefix}{wiText}{wiSuffix}{memText}{memSuffix}{prompt}",prefix:"",text:"",suffix:""},authorNoteTokens:{prefix:"",text:"",suffix:""},authorNoteDepth:3,worldInfo:{mikuPediaVersion:1,entries:[],prefix:"",suffix:""},logitBias:{bias:{},model:"none"},instructTemplates:{Alpaca:{sysPre:"### System:\\n",sysSuf:"",instPre:"\\n\\n### Instruction:\\n",instSuf:"\\n\\n### Response:"},Mistral:{sysPre:"<<SYS>>\\n",sysSuf:"<</SYS>>\\n\\n",instPre:"[INST]",instSuf:"[/INST]"},Codestral:{sysPre:"<<SYS>>\\n",sysSuf:"<</SYS>>\\n\\n",instPre:"[INST]",instSuf:"[/INST]",fimTemplate:"[SUFFIX]{suffix}[PREFIX]{prefix}"},ChatML:{sysPre:"<|im_start|>system\\n",sysSuf:"",instPre:"<|im_end|>\\n<|im_start|>user\\n",instSuf:"<|im_end|>\\n<|im_start|>assistant\\n"},"Llama 3":{sysPre:"<|start_header_id|>system<|end_header_id|>\\n\\n",sysSuf:"",instPre:"<|eot_id|><|start_header_id|>user<|end_header_id|>\\n\\n",instSuf:"<|eot_id|><|start_header_id|>assistant<|end_header_id|>\\n\\n"},"Phi 2":{sysPre:"",sysSuf:"",instPre:"\\nInstruct: ",instSuf:"\\nOutput: "},"Phi 3":{sysPre:"<|system|>\\n",sysSuf:"",instPre:"<|end|>\\n<|user|>\\n",instSuf:"<|end|>\\n<|assistant|>\\n"},"Command-R":{sysPre:"<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>",sysSuf:"",instPre:"<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|USER_TOKEN|>",instSuf:"<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>"},Metharme:{sysPre:"<|system|>",sysSuf:"",instPre:"<|user|>",instSuf:"<|model|>"},Vicuna:{sysPre:"",sysSuf:"\\n\\n",instPre:"\\nUSER: ",instSuf:"\\nASSISTANT: "},Gemma:{sysPre:"",sysSuf:"",instPre:"\\n<end_of_turn><start_of_turn>user\\n",instSuf:"\\n<end_of_turn><start_of_turn>model\\n"}},scrollTop:0};function ex(e){return e.map(e=>e.content).join("")}function e$(e,t){let n=(0,i.useMemo)(()=>{try{return JSON.parse(localStorage.getItem(e))}catch(e){return reportError(e),null}},[]),[r,a]=(0,i.useState)(n??t);return[r,t=>{a(n=>{let r="function"==typeof t?t(n):t;return localStorage.setItem(e,JSON.stringify(r)),r})}]}function eS({sessionStorage:e,templateStorage:t,useSessionState:n,useDBTemplates:r,isMikupadEndpoint:a}){let l=(0,i.useRef)(),o=(0,i.useRef)(),u=(0,i.useRef)([]),s=(0,i.useRef)([]),c=(0,i.useRef)(),h=(0,i.useRef)({}),y=(0,i.useRef)(),w=(0,i.useRef)(!0),[k,x]=r(ek.instructTemplates),[$,S]=(0,i.useState)(!1),[E,C]=(0,i.useState)(!1),[P,T]=n("template","Llama 3"),[F,N]=n("chatMode",!1),[A,_]=(0,i.useState)([]),[D,L]=(0,i.useState)(void 0),[O,I]=(0,i.useState)(!1),[U,H]=(0,i.useState)(!0),[W,K]=(0,i.useState)(null),[Q,X]=e$("spellCheck",!1),[q,J]=e$("attachSidebar",!1),[eu,ey]=e$("showProbsMode",0),[eg,ev]=e$("highlightGenTokens",!0),[eb,ew]=e$("colorizePerplexity",!1),[eS,eE]=e$("preserveCursorPosition",!0),[eC,eP]=e$("promptAreaWidth",void 0),[eT,eF]=e$("theme",0),[eN,eA]=(0,i.useState)(!1),[e_,eD]=(0,i.useState)(void 0),[eL,eO]=(0,i.useState)(!1),[eI,eB]=n("endpoint",ek.endpoint),[ez,eM]=n("endpointAPI",ek.endpointAPI),[eR,ej]=n("endpointAPIKey",ek.endpointAPIKey),[eV,eU]=n("endpointModel",ek.endpointModel),[eH,eW]=n("prompt",ek.prompt),[eK,eQ]=n("seed",ek.seed),[eX,eq]=n("maxPredictTokens",ek.maxPredictTokens),[eJ,eY]=n("temperature",ek.temperature),[eG,eZ]=n("dynaTempRange",ek.dynaTempRange),[e0,e1]=n("dynaTempExp",ek.dynaTempExp),[e2,e3]=n("repeatPenalty",ek.repeatPenalty),[e4,e5]=n("repeatLastN",ek.repeatLastN),[e8,e6]=n("penalizeNl",ek.penalizeNl),[e7,e9]=n("presencePenalty",ek.presencePenalty),[te,tt]=n("frequencyPenalty",ek.frequencyPenalty),[tn,tr]=n("topK",ek.topK),[ta,tl]=n("topP",ek.topP),[to,ti]=n("typicalP",ek.typicalP),[tu,ts]=n("minP",ek.minP),[tc,td]=n("tfsZ",ek.tfsZ),[tf,tp]=n("mirostat",ek.mirostat),[th,tm]=n("mirostatTau",ek.mirostatTau),[ty,tg]=n("mirostatEta",ek.mirostatEta),[tv,tb]=n("ignoreEos",ek.ignoreEos),[tw,tk]=n("openaiPresets",ek.openaiPresets),[tx,t$]=(0,i.useState)(!1),[tS,tE]=(0,i.useState)([]),[tC,tP]=(0,i.useState)(0),[tT,tF]=(0,i.useState)(0),[tN,tA]=(0,i.useState)(void 0),[t_,tD]=n("stoppingStrings",ek.stoppingStrings),[tL,tO]=(0,i.useState)(void 0),[tI,tB]=n("scrollTop",ek.scrollTop),[tz,tM]=(0,i.useState)({}),[tR,tj]=n("logitBias",ek.logitBias),[tV,tU]=(0,i.useState)({}),[tH,tW]=n("contextLength",ek.contextLength),[tK,tQ]=n("memoryTokens",ek.memoryTokens),[tX,tq]=n("authorNoteTokens",ek.authorNoteTokens),[tJ,tY]=n("authorNoteDepth",ek.authorNoteDepth),[tG,tZ]=n("worldInfo",ek.worldInfo);function t0(e,t){return e.replace(/\{[^}]+\}/g,function(e){return t.hasOwnProperty(e)?t[e]:e}).replace(/\\n/g,"\n")}function t1(e,t){tq(n=>({...n,[e]:t}))}function t2(e,t){tQ(n=>({...n,[e]:t}))}(0,i.useMemo)(()=>{S({"{inst}":k[P]?.instPre&&k[P]?.instPre!==""?k[P]?.instPre:"","{/inst}":k[P]?.instSuf&&k[P]?.instSuf!==""?k[P]?.instSuf:"","{sys}":k[P]?.sysPre&&k[P]?.sysPre!==""?k[P]?.sysPre:"","{/sys}":k[P]?.sysSuf&&k[P]?.sysSuf!==""?k[P]?.sysSuf:""})},[P,k]),(0,i.useEffect)(()=>{let t=tX.text&&""!==tX.text?["prefix","text","suffix"].map(e=>tX[e]).join(""):"";if(""==t||3==ez){tq(e=>({...e,tokens:0}));return}let n=new AbortController,r=setTimeout(async()=>{try{let r=await m({endpoint:eI,endpointAPI:ez,...3==ez||0==ez?{endpointAPIKey:eR}:{},content:`${t0(t,$)}`,signal:n.signal,...a?{proxyEndpoint:e.proxyEndpoint}:{}});tq(e=>({...e,tokens:r-1}))}catch(e){"AbortError"!==e.name&&(reportError(e),tq(e=>({...e,tokens:0})))}},500);return n.signal.addEventListener("abort",()=>clearTimeout(r)),()=>n.abort()},[tz.context,tX.text,tX.prefix,tX.suffix,W,eI,ez]),(0,i.useEffect)(()=>{let t=tK.text&&""!==tK.text?["prefix","text","suffix"].map(e=>tK[e]).join(""):"";if(""==t||3==ez){tQ(e=>({...e,tokens:0}));return}let n=new AbortController,r=setTimeout(async()=>{try{let r=await m({endpoint:eI,endpointAPI:ez,...3==ez||0==ez?{endpointAPIKey:eR}:{},content:`${t0(t,$)}`,signal:n.signal,...a?{proxyEndpoint:e.proxyEndpoint}:{}});tQ(e=>({...e,tokens:r-1}))}catch(e){"AbortError"!==e.name&&(reportError(e),tQ(e=>({...e,tokens:0})))}},500);return n.signal.addEventListener("abort",()=>clearTimeout(r)),()=>n.abort()},[tz.context,tK.text,tK.prefix,tK.suffix,W,eI,ez]),(0,i.useEffect)(()=>{let t=tK.worldInfo&&""!==tK.worldInfo?[tG.prefix,tK.worldInfo,tG.suffix].join(""):"";if(""==t||3==ez){tQ(e=>({...e,tokensWI:0}));return}let n=new AbortController,r=setTimeout(async()=>{try{let r=await m({endpoint:eI,endpointAPI:ez,...3==ez||0==ez?{endpointAPIKey:eR}:{},content:`${t0(t,$)}`,signal:n.signal,...a?{proxyEndpoint:e.proxyEndpoint}:{}});tQ(e=>({...e,tokensWI:r-1}))}catch(e){"AbortError"!==e.name&&(reportError(e),tQ(e=>({...e,tokensWI:0})))}},500);return n.signal.addEventListener("abort",()=>clearTimeout(r)),()=>n.abort()},[tz.context,tG.prefix,tK.worldInfo,tG.suffix,W,eI,ez]);let t3=e=>{let[t,n]="sys"==e?[k[P]?.sysPre||"",k[P]?.sysSuf||""]:[k[P]?.instPre||"",k[P]?.instSuf||""];if(!(t||n))return;let r=l.current;if(!r)return;let a=r.selectionStart,o=r.selectionEnd,i=r.value.substring(0,a)||"",u=r.value.substring(o),s=r.value.substring(a,o),c=i+t.replace(/\\n/g,"\n")+s+n.replace(/\\n/g,"\n")+u;r.value=c,0===s.length?t.length:(t.length,s.length,n.length),r.setSelectionRange(0,2),nf({target:r})},t4=e=>{tM(t=>({...t,[e]:!t[e]}))},t5=e=>{tM(t=>({...t,[e]:!1}))},t8=(0,i.useMemo)(()=>ex(eH),[eH]),{modifiedPromptText:t6,fimPromptInfo:t7}=(0,i.useMemo)(()=>{let e,t,n,r;if(W)return{modifiedPromptText:t8};let a="{fill}",l="{predict}",o=l;k[P]?.fimTemplate!==void 0&&k[P]?.fimTemplate.length>0&&(o+=`|${a}`);for(let e=0;e<eH.length;e++){let i=eH[e];if("user"===i.type&&(i.content.includes(a)||i.content.includes(l))){let[a,l]=function(e,t,n){let r;let a=[],l=[],o=0,i=RegExp(t,"g");for(;null!==(r=i.exec(e))&&!(a.length>=1);)a.push(e.slice(o,r.index)),l.push(r[0]),o=r.index+r[0].length;return a.push(e.slice(o)),[a,l]}(i.content,o,0);r=l[0];let u=a[0];(" "!=u.at(-2)||"	"!=u.at(-2))&&" "==u.at(-1)&&(u=u.substring(0,u.length-1)),t=[...eH.slice(0,e),...u?[{type:"user",content:u}]:[]];let s=a[1];n=[...s?[{type:"user",content:s}]:[],...eH.slice(e+1,eH.length)];break}}if(void 0===r)return{modifiedPromptText:t8};if("{fill}"==r){let r=ex(t),a=ex(n);e=t0(k[P].fimTemplate,{"{prefix}":r,"{suffix}":a})}else e=ex(t);return{modifiedPromptText:e,fimPromptInfo:{fimLeftChunks:t,fimRightChunks:n,fimPlaceholder:r}}},[eH,k,P,W]),t9=(0,i.useMemo)(()=>{let e=Array.isArray(tG.entries)?tG.entries.filter(e=>e.keys.length>0&&!(1==e.keys.length&&""==e.keys[0])&&""!==e.text):[],t=e.filter(t=>{if(e.length<1)return;let n=isNaN(t.search)||""===t.search?2048:Number(t.search),r=t6.substring(t6.length-n*ek.tokenRatio);return t.keys.some((e,t)=>{if(0!=r.length)try{return RegExp(e,"i").test(r)&&""!==e}catch(t){return console.error(`Error in RegEx for key '${e}': ${t.message}`),!1}})});return t.length>0?t.map(e=>e.text).join("\n"):""},[t6,tG]),ne=(0,i.useMemo)(()=>{tK.worldInfo=t9;let e=tX.text&&""!==tX.text?["prefix","text","suffix"].map(e=>tX[e]).join("").replace(/\\n/g,"\n"):"",t={"{wiPrefix}":t9&&""!==t9?tG.prefix:"","{wiText}":t9,"{wiSuffix}":t9&&""!==t9?tG.suffix:"","{memPrefix}":tK.text&&""!==tK.text||""!==t9?tK.prefix:"","{memText}":tK.text,"{memSuffix}":tK.text&&""!==tK.text||""!==t9?tK.suffix:""},n=Object.values(t).filter(e=>"string"==typeof e).join("").length,r=Math.round(t6.length-tH*ek.tokenRatio+n)+1,a=t6.substring(r),l=a.split("\n").length,o=l>tJ?tJ:l,i=a.match(/.*\n?/g),u=i.length-o-1;i.splice(u,0,e);let s=""!=e?i.join(""):a;return t["{prompt}"]=s,(tK.contextOrder&&""!==tK.contextOrder?tK.contextOrder:ek.memoryTokens.contextOrder).split("\n").map(function(e){return t0(e,t)}).filter(function(e){return""!==e.trim()}).join("\n").replace(/\\n/g,"\n")},[tH,t6,tK,tX,tJ,t9,tG.prefix,tG.suffix]),nt=(0,i.useMemo)(()=>t0(ne,$),[ne,k,P]);async function nn(){if(void 0===t7)return!1;let{fimLeftChunks:e,fimRightChunks:t}=t7;return nr(nt,e.length,n=>(e.push(n),eW(n=>[...e,...t]),tP(e=>e+(n?.completion_probabilities?.length??1)),!0)),!0}async function nr(t=nt,n=eH.length,r){if(W){W?.();let e=!1;if(K(()=>()=>e=!0),await new Promise(e=>setTimeout(e,500)),e)return!1}if(!r&&!nu&&await nn())return!0;let o=new AbortController,i=()=>{b({endpoint:eI,endpointAPI:ez,...a?{proxyEndpoint:e.proxyEndpoint}:{}}),o.abort()};K(()=>i),tA(void 0);try{if(tF(tC),r)u.current=[];else{let r=await m({endpoint:eI,endpointAPI:ez,...3==ez||0==ez?{endpointAPIKey:eR}:{},content:t,signal:o.signal,...a?{proxyEndpoint:e.proxyEndpoint}:{}});if(tP(r),tF(r),F&&!nu&&k[P]){var c;let{instSuf:e,instPre:n}=(c=k[P],Object.fromEntries(Object.entries(c).map(([e,t])=>[e,t?.replaceAll("\\n","\n")]))),r=e?t.lastIndexOf(e):-1,a=n?t.lastIndexOf(n):-1;r<=a&&(eW(t=>[...t,{type:"user",content:e}]),t+=e)}for(ns(!1);u.current.at(-1)>=n;)u.current.pop();u.current.push(n)}for await(let i of(s.current=[],I(!1),t$(!1),l.current.scrollTarget=void 0,w.current=!0,v({endpoint:eI,endpointAPI:ez,...3==ez||0==ez?{endpointAPIKey:eR,model:eV}:{},prompt:t,...-1!=eK?{seed:eK}:{},temperature:eJ,...tw&&3==ez?{}:{dynatemp_range:eG,dynatemp_exponent:e0,repeat_penalty:e2,repeat_last_n:e4,penalize_nl:e8,ignore_eos:tv},...Object.keys(tR.bias).length>0&&3!=ez?{logit_bias:tV}:{},presence_penalty:e7,frequency_penalty:te,...tf&&(!tw||3!=ez)?{mirostat:tf,mirostat_tau:th,mirostat_eta:ty}:{top_p:ta,...tw&&3==ez?{}:{top_k:tn,typical_p:to,min_p:tu,tfs_z:tc}},n_predict:eX,n_probs:10,...JSON.parse(t_).length?{stop:JSON.parse(t_)}:{},signal:o.signal,...a?{proxyEndpoint:e.proxyEndpoint}:{}})))if(o.signal.throwIfAborted(),i.stopping_word&&(i.content=i.stopping_word),i.content){if(r){if(!r(i))break}else eW(e=>[...e,i]),tP(e=>e+(i?.completion_probabilities?.length??1));n+=1}}catch(e){if("AbortError"!==e.name){reportError(e);let t=e.toString();(3==ez||0==ez)&&t.includes("401")?(tA("Error: Rejected API Key"),t$(!0)):3==ez&&t.includes("429")?tA("Error: Insufficient Quota"):tA(t)}return!1}finally{K(e=>e===i?null:e),r||u.current.at(-1)!==n||u.current.pop()}if(!r&&F){let e=k[P]?.instPre.replace(/\\n/g,"\n");eW(t=>[...t,{type:"user",content:e}]),t+=`${e}`}return!0}function na(){return!!u.current.length&&(s.current.push(eH.slice(u.current.at(-1))),eW(e=>e.slice(0,u.current.pop())),!0)}function nl(){return!!s.current.length&&(u.current.push(eH.length),eW(e=>[...e,...s.current.pop()]),I(!1),!0)}let[no,ni]=(0,i.useState)(!1),[nu,ns]=(0,i.useState)(!1);function nc(){u.current.length&&!no&&na()&&ni(!0)}function nd(){let t=e.getProperty("name");document.title=t?"mikupad - "+t:"mikupad"}function nf({target:e}){eW(t=>{let n=[],r=[],a=t.length;t=[...t];let l=e.value;for(;t.length;){let e=t[0];if(!l.startsWith(e.content))break;t.shift(),n.push(e),l=l.slice(e.content.length)}for(;t.length;){let e=t.at(-1);if(!l.endsWith(e.content))break;t.pop(),r.unshift(e),l=l.slice(0,-e.content.length)}let o=(e,t)=>{let n=e[e.length-1];for(;n&&"user"===n.type;){if(n.content+=t,!e[e.length-2]||"user"!==e[e.length-2].type)return e;t=n.content,n=e[e.length-2],e.splice(e.length-1,1)}return[...e,{type:"user",content:t}]},i=[...n];l&&(i=o(i,l)),r.length&&"user"===r[0].type&&(i=o(i,r.shift().content)),i.push(...r),u.current=u.current.filter(e=>e>n.length&&e<i.length),u.current.length||I(!1);let c=a-i.length;return u.current=u.current.map(e=>e>=n.length?e-c:e),c<0&&!r.length&&(s.current=[]),i})}async function np(e,t){eH.slice(e).some(e=>"user"===e.type)||(eW([...eH.slice(0,e),{...eH[e],content:t.tok_str,prob:t.prob}]),ni(!0),ns(!0))}function nh(){let e;let t="https:"==window.location.protocol;try{e=new URL(eI)}catch{return!1}return t&&"https:"!==e.protocol&&"wss:"!==e.protocol}(0,i.useEffect)(()=>{nd()},[e]),(0,i.useEffect)(()=>{no&&(nr(),ni(!1))},[no]),(0,i.useLayoutEffect)(()=>{q?document.body.classList.add("attachSidebar"):document.body.classList.remove("attachSidebar")},[q]),(0,i.useLayoutEffect)(()=>{if(eC){let e=document.querySelector("#prompt-container");e.style.setProperty("min-width",eC),e.style.setProperty("max-width",eC)}},[eC]),(0,i.useLayoutEffect)(()=>{switch(document.documentElement.classList.remove("serif-dark"),document.documentElement.classList.remove("monospace-dark"),document.documentElement.classList.remove("nockoffAI"),eT){case 1:document.documentElement.classList.add("serif-dark");break;case 2:document.documentElement.classList.add("monospace-dark");break;case 3:document.documentElement.classList.add("nockoffAI")}},[eT]),(0,i.useEffect)(()=>{try{JSON.parse(t_),tO(void 0)}catch(e){tO(e.toString())}},[t_]),(0,i.useEffect)(()=>{if(-1===eu)return;let e=()=>{let e=document.getElementById("probs");if(!e)return;e.style.display="",e.style.setProperty("--probs-top",`${D.top}px`),e.style.setProperty("--probs-left",`${D.left}px`);let t=e.getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth;if(window.innerHeight||document.documentElement.clientHeight,t.right>n){let r=n-t.width/2;e.style.setProperty("--probs-left",`${r}px`)}t.left<0&&e.style.setProperty("--probs-left",`${t.width/2}px`)};D&&U&&setTimeout(()=>{e()})},[D,U]),(0,i.useLayoutEffect)(()=>{let e=l.current;if(e.value!==t8){if(e.value.length&&t8.startsWith(e.value)){let t=e.selectionStart!==e.selectionEnd,n=e.scrollHeight,r=(e.scrollTarget??e.scrollTop)+e.clientHeight+1>n,a=e.value.length;(t||eS)&&!F?e.setRangeText(t8.slice(a),a,a,"preserve"):e.value=t8;let l=e.scrollHeight;r&&n!==l&&(e.scrollHeight-(e.scrollTop+e.clientHeight+1)>=100&&(w.current=!1),e.scrollTarget=l-e.clientHeight,e.scrollTo({top:l-e.clientHeight,behavior:w.current?"smooth":"instant"}))}else e.value=t8}},[t8]),(0,i.useLayoutEffect)(()=>{W||(l.current.scrollTarget=void 0,l.current.scrollTop=tI,o.current.scrollTop=tI)},[tI,eg,eu]),(0,i.useEffect)(()=>{if(W)return;let t=new AbortController,n=setTimeout(async()=>{try{let n=await m({endpoint:eI,endpointAPI:ez,...3==ez||0==ez?{endpointAPIKey:eR}:{},content:nt,signal:t.signal,...a?{proxyEndpoint:e.proxyEndpoint}:{}});tP(n)}catch(e){"AbortError"!==e.name&&reportError(e)}},500);return t.signal.addEventListener("abort",()=>clearTimeout(n)),()=>t.abort()},[tz.context,t8,W,eI,ez]),(0,i.useEffect)(()=>{if(3!=ez)return;t$(!1);let t=new AbortController,n=setTimeout(async()=>{try{let n=await g({endpoint:eI,endpointAPI:ez,...3==ez?{endpointAPIKey:eR}:{},signal:t.signal,...a?{proxyEndpoint:e.proxyEndpoint}:{}});tE(n)}catch(e){if("AbortError"!==e.name){reportError(e);let t=e.toString();3==ez&&t.includes("401")&&t$(!0)}}},500);return t.signal.addEventListener("abort",()=>clearTimeout(n)),()=>t.abort()},[eI,ez,eR]),(0,i.useEffect)(()=>{function e(e){let{altKey:t,ctrlKey:n,shiftKey:r,key:a,defaultPrevented:l}=e;if(!l){switch(`${t}:${n}:${r}:${a}`){case"false:false:true:Enter":case"false:true:false:Enter":nr();break;case"false:false:false:Escape":W();break;case"false:true:false:r":case"false:false:true:r":nc();break;case"false:true:false:z":case"false:false:true:z":if(W||!na())return;break;case"false:true:true:Z":case"false:true:false:y":case"false:false:true:y":if(W||!nl())return;break;default:h.current=e;return}e.preventDefault()}}function t(e){let{altKey:t,ctrlKey:n,shiftKey:r,key:a,defaultPrevented:l}=e;l||(h.current=e)}return window.addEventListener("keydown",e),window.addEventListener("keyup",t),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",t)}},[nr,W]),(0,i.useEffect)(()=>{let e,t,n;let r=document.querySelector("#prompt-container"),a=!1;function o(e){let t=r.getBoundingClientRect();return e.clientX-t.left<5&&e.clientX-t.left>0?"left":t.right-e.clientX<5&&t.right-e.clientX>0&&"right"}function i(i){let u=o(i);if(!u)return;l.current.selectionStart=l.current.selectionEnd,a=!0;let s="right"==u?r.getBoundingClientRect().left:r.getBoundingClientRect().right;e=i.clientX-s,t=getComputedStyle(r).getPropertyValue("max-width"),n=u}function u(i){switch(o(i)){case"right":l.current.style.cursor="col-resize",r.style.cursor="col-resize",r.style.borderRight="2px dotted var(--color-light)";break;case"left":l.current.style.cursor="col-resize",r.style.cursor="col-resize",r.style.borderLeft="2px dotted var(--color-light)";break;default:l.current.style.cursor="",r.style.cursor="",r.style.borderRight="2px dotted transparent",r.style.borderLeft="2px dotted transparent"}if(!a)return;l.current.selectionStart=l.current.selectionEnd;let u="right"==n?r.getBoundingClientRect().left:r.getBoundingClientRect().right,s=i.clientX-u;eP(`calc(${t} + ${(s-e)*("right"==n?1:-1)}px)`)}function s(){a=!1}return r.addEventListener("mousedown",i),document.addEventListener("mousemove",u),document.addEventListener("mouseup",s),document.addEventListener("mouseleave",s),()=>{r.removeEventListener("mousedown",i),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",s),document.removeEventListener("mouseleave",s)}},[]),(0,i.useEffect)(()=>{function t(){s.current=[],u.current=[],I(!1),nd()}function n(){y.current||(y.current=setInterval(async()=>{try{await e.dbAdapter.init(),eD(void 0),clearTimeout(y.current),y.current=void 0}catch(e){reportError(e)}},1e3)),eD("Mikupad server is unreachable!"),L(void 0),I(!1)}return e.addEventListener("sessionchange",t),e.addEventListener("error",n),()=>{e.removeEventListener("sessionchange",t),e.removeEventListener("error",n)}},[]);let nm=(0,i.useMemo)(()=>U&&eH[D?.index]?.completion_probabilities?.[0]?.probs,[eH,D,U]),ny=(0,i.useRef)(null),[ng,nv]=(0,i.useState)(0),[nb,nw]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{nv(ny.current.scrollHeight);let e=new f(()=>{nw(window.innerWidth<767.8),nv(ny.current.scrollHeight)});return e.observe(ny.current),()=>e.disconnect()},[]),d`
		<div id="prompt-container" onMouseMove=${function({clientX:e,clientY:t}){if(-1===eu&&!eg)return;o.current.style.pointerEvents="auto";let n=document.elementFromPoint(e,t),r=n?.closest?.("[data-promptchunk]"),a=n?.closest?.("#probs");if(o.current.style.pointerEvents="none",a)return;if(!r){L(void 0);return}let l=[...r.getClientRects()].at(-1),i=+r.dataset.promptchunk,u=l.top,s=l.x+l.width/2;L(e=>{let t=e&&e.index===i&&e.top===u&&e.left===s;switch(eu){case 0:t&&U||(H(!1),clearTimeout(c.current),c.current=setTimeout(()=>H(!0),300));break;case 1:H(h.current.ctrlKey)}return t?e:{index:i,top:u,left:s}})}} style=${{"margin-bottom":nb?ng+"px":0}}>
			<button
				className="textAreaSettings"
				onClick=${()=>t4("prompt")}>
				<${Y}/>
			</button>
			<textarea
				ref=${l}
				readOnly=${!!W}
				spellCheck=${Q}
				id="prompt-area"
				onInput=${nf}
				onScroll=${function({target:e}){e.scrollTop===e.scrollTarget&&(e.scrollTarget=void 0);let t=e.scrollTop,n=o.current.scrollTop;if(t<n&&(e.scrollTarget=void 0),o.current.scrollTop=e.scrollTop,o.current.scrollLeft=e.scrollLeft,tB(t),-1!==eu){let e=document.getElementById("probs");if(e){let r=getComputedStyle(e).getPropertyValue("top");e.style.setProperty("--probs-top",`calc(${r} + ${n-t}px)`)}else D&&(D.top+=n-t)}}}/>
			<div ref=${o} id="prompt-overlay" aria-hidden>
				${eg||-1!==eu?d`
					${eH.map((e,t)=>{let n=e.prob??1,r=D&&D.index===t,a=O&&!!u.current.length&&u.current.at(-1)<=t;return d`
							<span
								key=${t}
								data-promptchunk=${t}
								style=${eb&&n<1?{"--bg-color":(e=>{let t=Math.max(0,Math.min(1,e));if(t<=.5){let e=t/.5;return`color-mix(in srgb, red ${100-100*e}%, yellow ${100*e}%)`}{let e=(t-.5)/.5;return`color-mix(in srgb, yellow ${100-100*e}%, var(--color-miku) ${100*e}%)`}})(n)}:{}}
								className=${`${(eg||r)&&"user"!==e.type?"machine":"user"} ${r?"current":""} ${a?"erase":""}`}>
								${("\n"===e.content?" \n":e.content)+(t===eH.length-1&&e.content.endsWith("\n")?" ":"")}
							</span>`})}`:null}
			</div>
		</div>
		${nm?d`
			<div
				id="probs"
				style=${{display:"none"}}>
				${nm.map((e,t)=>{let n=D?.index,r=eH[n]?.prob==e.prob;return d`<button key=${t} className=${r?"current":""} onClick=${()=>np(n,e)}>
						<div className="tok">${e.tok_str.replace(/[\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,e=>{let t=e.charCodeAt(0);return`<0x${t.toString(16).toUpperCase().padStart(2,"0")}>`})}</div>
						<div className="prob">${(100*e.prob).toFixed(2)}%</div>
					</button>`})}
			</div>`:null}
		<div id="sidebar" ref=${ny} style=${{"max-height":""}}>
			<${z}
				label="Theme"
				value=${eT}
				onValueChange=${eF}
				options=${[{name:"Serif Light",value:0},{name:"Serif Dark",value:1},{name:"Monospace Dark",value:2},{name:"nockoffAI",value:3}]}/>
			<div class="horz-separator"/>
			<${j} label="Sessions">
				<${V} sessionStorage=${e} disabled=${!!W}/>
			</${j}>
			<${j} label="Parameters" expanded>
				<${B} label="Server"
					className="${nh()?"mixed-content":""}"
					tooltip="${nh()?"This URL might be blocked due to mixed content. If the prediction fails, download mikupad.html and run it locally.":""}"
					readOnly=${!!W}
					value=${eI}
					onValueChange=${eB}/>
				<${z}
					label="API"
					disabled=${!!W}
					value=${ez}
					onValueChange=${function(e){let t;try{t=new URL(eI)}catch{return}switch(e){case 0:"http:"!=t.protocol&&"https:"!=t.protocol&&(t.protocol="http:"),t.port=8080;break;case 2:"http:"!=t.protocol&&"https:"!=t.protocol&&(t.protocol="http:"),t.port=5001;break;case 3:"http:"!=t.protocol&&"https:"!=t.protocol&&(t.protocol="http:")}eB(t.toString()),eM(e)}}
					options=${[{name:"llama.cpp",value:0},{name:"koboldcpp",value:2},{name:"openai-compatible",value:3}]}/>
				${(3==ez||0==ez)&&d`
					<div className="hbox-flex" style=${{"flex-wrap":"unset"}}>
						<${B} label="API Key" type="${eL?"text":"password"}"
							className="${tx?"rejected":""}"
							tooltip="${tx?"This API Key was rejected by the backend.":""}"
							tooltipSize="short"
							readOnly=${!!W}
							value=${eR}
							onValueChange=${ej}/>
						<button title="${eL?"Hide API Key":"Show API Key"}"
							className="eye-button"
							disabled=${!!W}
							onClick=${()=>eO(!eL)}>
							${eL?d`<${ee}/>`:d`<${Z}/>`}
						</button>
					</div>`}
				${3==ez&&d`
					<${B} label="Model"
						datalist=${tS}
						readOnly=${!!W}
						value=${eV}
						onValueChange=${eU}/>`}
				<div className="buttons instructTemplateSidebar">
					<${M}
						label="Instruct Template"
						disabled=${!!W}
						value=${P}
						onValueChange=${T}
						options=${A}/>
					<button
						title="Edit Instruct Templates"
						disabled=${!!W}
						class="symbol-button"
						onClick=${()=>t4("instruct")}>
						<${Y} style=${{width:".95em",transform:"translate(-50%, -45%)"}}/>
					</button>
					<button
						title="Insert System Prompt Template"
						disabled=${!!W}
						class="symbol-button"
						onClick=${()=>t3("sys")}>
						<${et} style=${{width:".9em"}}/>
					</button>
					<button
						title="Insert Instruct Template"
						disabled=${!!W}
						class="symbol-button"
						onClick=${()=>t3("inst")}>
						<${en} style=${{height:"1.05em",transform:"translate(-50%, -60%)"}}/>
					</button>
					<button
						title="Toggle Chat Mode ${F?"Off":"On"}"
						disabled=${!!W}
						class="symbol-button"
						onClick=${()=>N(e=>!e)}>
						${F?d`<${er} style=${{width:".9em"}} />`:d`<${ea} style=${{width:"1.05em"}} />`}
					</button>
				</div>
				<${B} label="Seed (-1 = random)" type="text" inputmode="numeric"
					readOnly=${!!W} value=${eK} onValueChange=${eQ}/>
				<${B} tooltip="Currently not accurate to the token count, it will be used as an estimate." label="Max Context Length" type="text" inputmode="numeric"
					readOnly=${!!W} value=${tH} onValueChange=${tW}/>
				<${B} label="Max Predict Tokens${0!=ez?" (-1 = 1024)":" (-1 = infinite)"}" type="text" inputmode="numeric"
					readOnly=${!!W} value=${eX} onValueChange=${eq}/>
				<${B} label="Stopping Strings (JSON array)" type="text" pattern="^\\[.*?\\]$"
					className="${tL?"rejected":""}"
					tooltip="${tL||""}"
					readOnly=${!!W}
					value=${t_}
					onValueChange=${tD}/>
			</${j}>
			<${j} label="Sampling" expanded>
				${3==ez&&d`
					<${R} label="Full OpenAI compliance"
						disabled=${!!W} value=${tw} onValueChange=${tk}/>`}
				<${B} label="Temperature" type="number" step="0.01"
					readOnly=${!!W} value=${eJ} onValueChange=${eY}/>
				${(!tw||3!=ez)&&d`
					<div className="hbox">
						<${B} label="DynaTemp Range" type="number" step="0.01"
							readOnly=${!!W} value=${eG} onValueChange=${eZ}/>
						${2!=ez&&d`
							<${B} label="DynaTemp Exp" type="number" step="0.01"
								readOnly=${!!W} value=${e0} onValueChange=${e1}/>`}
					</div>
					<div className="hbox">
						<${B} label="Repeat penalty" type="number" step="0.01"
							readOnly=${!!W} value=${e2} onValueChange=${e3}/>
						<${B} label="Repeat last n" type="number" step="1"
							readOnly=${!!W} value=${e4} onValueChange=${e5}/>
					</div>`}
				${(0==ez||!tw||3==ez)&&d`
					${1!=ez&&(!tw||3!=ez)&&d`
						<${R} label="Penalize NL"
							disabled=${!!W} value=${e8} onValueChange=${e6}/>`}
					<div className="hbox">
						<${B} label="Presence penalty" type="number" step="0.01"
							readOnly=${!!W} value=${e7} onValueChange=${e9}/>
						<${B} label="Frequency penalty" type="number" step="1"
							readOnly=${!!W} value=${te} onValueChange=${tt}/>
					</div>`}
				${eJ<=0?null:d`
					${(!tw||3!=ez)&&d`
						<${z}
							label="Mirostat"
							disabled=${!!W}
							value=${tf}
							onValueChange=${tp}
							options=${[{name:"Off",value:0},{name:"Mirostat",value:1},{name:"Mirostat 2.0",value:2}]}/>`}
					${tf&&(!tw||3!=ez)?d`
						<div className="hbox">
							<${B} label="Mirostat τ" type="number" step="0.01"
								readOnly=${!!W} value=${th} onValueChange=${tm}/>
							<${B} label="Mirostat η" type="number" step="0.01"
								readOnly=${!!W} value=${ty} onValueChange=${tg}/>
						</div>
					`:d`
						<div className="hbox">
							${(!tw||3!=ez)&&d`
								<${B} label="Top K" type="number" step="1"
									readOnly=${!!W} value=${tn} onValueChange=${tr}/>`}
							<${B} label="Top P" type="number" step="0.01"
								readOnly=${!!W} value=${ta} onValueChange=${tl}/>
							${(!tw||3!=ez)&&d`
								<${B} label="Min P" type="number" step="0.01"
									readOnly=${!!W} value=${tu} onValueChange=${ts}/>`}
						</div>
						${(!tw||3!=ez)&&d`
							<div className="hbox">
								<${B} label="Typical p" type="number" step="0.01"
									readOnly=${!!W} value=${to} onValueChange=${ti}/>
								<${B} label="TFS z" type="number" step="0.01"
									readOnly=${!!W} value=${tc} onValueChange=${td}/>
							</div>`}
					`}
				`}
				${3!=ez&&d`
					<button
						disabled=${!!W}
						onClick=${()=>t4("bias")}>
						Logit Bias
						</button>`}
				${(!tw||3!=ez)&&d`
					<${R} label="Ignore <eos>"
						disabled=${!!W} value=${tv} onValueChange=${tb}/>`}


			</${j}>
			<${j} label="Persistent Context">
				<label className="TextArea">
					<div>Memory ${tK.tokens>0?d`<small>(${tK.tokens} Tokens)</small>`:""}</div>
					<textarea
					readOnly=${!!W}
					placeholder="Anything written here will be injected at the head of the prompt. Tokens here DO count towards the Context Limit."
					defaultValue=${tK.text}
					value=${tK.text}
					onInput=${e=>t2("text",e.target.value)}
					id="memory-area"/>
					<button
					className="textAreaSettings"
					disabled=${!!W}
					onClick=${()=>t4("memory")}>
						<${Y}/>
					</button>
				</label>
				<label className="TextArea">
					<div>Author's Note ${tX.tokens>0?d`<small>(${tX.tokens} Tokens)</small>`:""}</div>
					<textarea
					readOnly=${!!W}
					placeholder="Anything written here will be injected ${tJ} newlines from bottom into context."
					defaultValue=${tX.text}
					value=${tX.text}
					onInput=${e=>t1("text",e.target.value)}
					id="an-area"/>
					<button
					className="textAreaSettings"
					disabled=${!!W}
					onClick=${()=>t4("an")}>
						<${Y}/>
					</button>
				</label>
				<button
					id="viewWorldInfo"
					disabled=${!!W}
					onClick=${()=>t4("wi")}>
					Show World Info
				</button>
				<button
					id="viewContext"
					disabled=${!!W}
					onClick=${()=>t4("context")}>
					Show Context
				</button>

			</${j}>
			${!!tC&&d`
				<${B} label="Tokens" value=${tC} readOnly/>`}
			<div className="buttons">
				<button
					title="Run next prediction (Ctrl + Enter)"
					className=${W&&!eN?tT===tC?"processing":"completing":""}
					disabled=${!!W||tL}
					onClick=${()=>nr()}>
					Predict
				</button>
				<button
					title="Cancel prediction (Escape)"
					disabled=${!W||eN}
					onClick=${W}>
					Cancel
				</button>
				<div className="shorts">
					<button
						title="Regenerate (Ctrl + R)"
						disabled=${!u.current.length}
						onClick=${()=>nc()}
						onMouseEnter=${()=>I(!0)}
						onMouseLeave=${()=>I(!1)}>
						<${el}/>
					</button>
				</div>

				<div className="shorts">
					<button
						title="Undo (Ctrl + Z)"
						disabled=${!!W||!u.current.length}
						onClick=${()=>na()}
						onMouseEnter=${()=>I(!0)}
						onMouseLeave=${()=>I(!1)}>
						<${eo}/>
					</button>
					<button
						title="Redo (Ctrl + Y)"
						disabled=${!!W||!s.current.length}
						onClick=${()=>nl()}>
						<${ei}/>
					</button>
				</div>
				<button
					id="button-settings"
					onClick=${()=>{for(let e of(t4("settings"),document.getElementsByClassName("SelectBox")[0].style.display=tz.settings?"none":"block",document.getElementsByClassName("horz-separator")[0].style.display=tz.settings?"none":"block",document.getElementsByClassName("collapsible-group")))e.style.display=tz.settings?"none":"block"}}>
					<${G}/>
				</button>
			</div>
			${!!tN&&d`
				<span className="error-text">${tN}</span>`}
		</div>

		<${es}
			isOpen=${tz.prompt}
			closeModal=${()=>t5("prompt")}>
			<${R} label="Enable spell checking"
				value=${Q} onValueChange=${X}/>
			<${R} label="Attach sidebar"
				value=${q} onValueChange=${J}/>
			<${R} label="Highlight generated tokens"
				value=${eg} onValueChange=${ev}/>
			<${R} label="Colorize perplexity"
				value=${eb} onValueChange=${ew}/>
			<${R} label="Preserve cursor position after prediction (disabled in Chat Mode)"
				value=${eS} onValueChange=${eE}/>
			<${z}
				label="Token probabilities"
				value=${eu}
				onValueChange=${ey}
				options=${[{name:"Show on hover",value:0},{name:"Show on hover while holding CTRL",value:1},{name:"Don't show",value:-1}]}/>
			<div style=${{display:"flex",justifyContent:"flex-start"}}>
				<button onClick=${()=>p(`${e.getProperty("name")}.txt`,l.current.value)}>
					Export prompt to plaintext
				</button>
			</div>
		</${es}>

		<${ec}
			isOpen=${tz.memory}
			closeModal=${()=>t5("memory")}
			memoryTokens=${tK}
			handleMemoryTokensChange=${t2}
			cancel=${W}/>

		<${ed}
			isOpen=${tz.an}
			closeModal=${()=>t5("an")}
			authorNoteTokens=${tX}
			handleauthorNoteTokensChange=${t1}
			authorNoteDepth=${tJ}
			setAuthorNoteDepth=${tY}
			cancel=${W}/>

		<${ef}
			isOpen=${tz.context}
			closeModal=${()=>t5("context")}
			tokens=${tC}
			memoryTokens=${tK}
			authorNoteTokens=${tX}
			handleMemoryTokensChange=${t2}
			finalPromptText=${nt}
			defaultPresets=${ek}
			cancel=${W}/>

		<${ep}
			isOpen=${tz.wi}
			closeModal=${()=>t5("wi")}
			worldInfo=${tG}
			setWorldInfo=${tZ}
			cancel=${W}/>

		<\!-- TODO: The amount of parameters in this modal is a bit excessive... -->
		<${eh}
			isOpen=${tz.bias}
			closeModal=${()=>t5("bias")}
			logitBias=${tR}
			setLogitBias=${tj}
			logitBiasParam=${tV}
			setLogitBiasParam=${tU}
			sessionStorage=${e} endpoint=${eI} endpointAPI=${ez} endpointAPIKey=${eR} isMikupadEndpoint=${a}
			cancel=${W}/>

		<\!-- Sorry. -->
		<${em}
			isOpen=${tz.instruct}
			closeModal=${()=>t5("instruct")}
			templateList=${A}
			setTemplateList=${_}
			selectedTemplate=${P}
			setSelectedTemplate=${T}
			templatesImport=${E}
			templates=${k}
			setTemplates=${x}
			templateStorage=${t}
			cancel=${W}/>

		${e_&&d`
			<div className="modal-overlay">
				<div id="error-bar">
					<div>
						${e_}
					</div>
				</div>
			</div>`}
	`}!async function(){let e=new ey,n=!1;if("file:"!=window.location.protocol&&"/"==window.location.pathname){let t=new eg(window.location.protocol+"//"+window.location.host);try{await t.init(),e=t,n=!0}catch(e){reportError(e)}}let r=new ew(e);await r.init();let a=new eb(e);await a.init(),t(document.body).render(d`
		<${eS}
			sessionStorage=${r}
			templateStorage=${a}
			useSessionState=${(e,t)=>(function(e,t,n){let r=(0,i.useMemo)(()=>{try{return e.getProperty(t)}catch(e){return reportError(e),null}},[]),[a,l]=(0,i.useState)(r??n);return(0,i.useEffect)(()=>{function r(){l(e.getProperty(t)??JSON.parse(JSON.stringify(n)))}return e.addEventListener("sessionchange",r),()=>e.removeEventListener("sessionchange",r)},[]),[a,n=>{l(r=>{let a="function"==typeof n?n(r):n;return e.setProperty(t,a),a})}]})(r,e,t)}
			useDBTemplates=${e=>(function(e,t){let n=(0,i.useMemo)(()=>e.templates,[]),[r,a]=(0,i.useState)(0===Object.keys(n).length?t:n);return[r,t=>{a(n=>{let r="function"==typeof t?t(n):t;return e.saveTemplates(r),r})}]})(a,e)}
			isMikupadEndpoint=${n}/>`)}();</script>
